BBLottery
BBLottery
BBLottery is a lottery - nothing more, nothing less. It features multiple tickets for the lottery, some stats about the lottery, configuration of the intervall a ticketnumber is drawn, the initial pot, the ticketrange,price and tax and how many tickets may be bought.
Configuration
intervall: The time between drawings in minutes
pot: The inital jackpot, every time someone wins, it gets reset to this amount
range: The ticket-range, the higher this number, the less likey it is that the lottery is won (each ticket has a chance of 1/range to win)
maxTickets: How many tickets a player may buy per round
ticketPrice: How much a ticket costs
tax: Tax on the tickets, so not the full price gets added to the jackpot
If you set the range to -1, the tickets will be given out in order, so first one to buy a ticket gets #1, second #2 and so on, and the winnig ticket will be taken from the bought tickets
Commands
- /lottery - Shows the help
- /lottery buy [ticketnumber] - buys a ticket with the given number, if no number is given, buys a random Ticket
- /lottery give <player> [ticketnumber] - like /lottery buy, but buys ticket for another player (target has to be online)
- /lottery info- current jackpot, tickets the player has bought and how much money a player would get if he won with a ticket
- /lottery stats - shows some stats about the lottery
Some admin-comands:
- /lottery reload - reloads the config
- /lottery draw [-f]- forces the lottery to draw a ticketnumber and start the next round, if -f is set it also reloads the lottery.yml
Permissions
- bblottery.buy - You can buy a ticket
- bblottery.buy.multi - You can buy up to <maxTickets> tickets
- bblottery.buy.other - You can buy a ticket for someone else
- bblottery.draw - You can force the next round
- bblottery.reload - You can reload the config
TODO
Fix Resetting Tickets-bug- Draw at specific time
- Suggestions!
Requires Vault and an economy-plugin
If you want to thank me, a little donation on Paypal is appreciated:
It does not work!!!11
If you encounter any problems with BBLottery give me as much info as you have, so that I can help you to the best I can. You got an error? go to the Server-Log and look for the error-message/stacktrace. Version of the plugin and Bukkit you are using would also be nice. Got no error-message? Then tell me what you were doing/typing. If I don't know what happend I can't fix it.
Best lottery plugin there is.
I'm trying to install this plugin on my new 1.7.10 Spigot server, but whenever I add it using FTP access, no files are created and it's as if the plugin is completely ignored. In-game when players try to use /lottery buy, etc commands it simply gives them "/<command". Could you tell me why this is? Is the version outdated (1.2.2 for 1.7.2-RO.3), or is it something else? Is there another plugin required for this one to be used? The console says nothing when players use lottery commands, just the "/<command" message.
On our server, the plugin doesn't reward offline players, if they win the jackpot...
Nice plugin but please fix the issue with player and logging out. -> player buy a number and is going offline after the cooldown: the offline player won but he dont get a reard because its a error in a console andplugin breaks to server restart or reload.
very annoying.
From my experiences the lottery.yml doesn't reset if the winner of the lottery is offline at the time of the drawing.
I already use the newest Version. Problem is also if the lucky guy, who won that game isn't online. Also nobody can buy a ticket after this.
And yes, this is all the console says. I also was kind of surprised.
@XhadiusLP try version 1.2.1 of this plugin...and is that everything the sonsole says? Usually the stackrace is a bit longer...
Everytime I restart the server it come this message, when I enter a command from this Plugin:
The console says me this:
I'm using spigot-1.5.2-R0.2 #878
Well, I don't see any reason it should not work with 1.5.2 except the things mentioned by @Atlas_Minecraft
@The_Newbizzle
does this work with 1.5.2?
Ahhh, my bad, I mixed up maxTickets and range...I will implement the suggestion for maxTickets asap
When I set the maxtickets to -1, it told me I had the next number of tickets whenever I bought a ticket.
@Xcelsior1991
I will try setting max tickets to -1 and interval to 0; I use 1.2.1
@Atlas_Minecraft Ok, i will look into it...if it crashes, a stacktrace would be nice if possible and try making a new comment when you get a bug or another feature-request...or to open a ticket instead of editing, that way i get a notification. Regarding your first two edits: setting maxtickets to -1 should allready be possible, and you can set the interval to 0 and what version of the lottery do you use?
@jacobml2000 Have you tried restarting your server? What version do you use (bukkit as well as the lottery)? Is there anything in the log regarding this matter?
When I download it onto my server it says everything is ok when I type in a command it just says /lottery for every command I type, and no config folder is spawned when I reload
Thank you so much for adding my suggestions to this plugin, I will be implementing it shortly on my server mc.atlasminecraft.com. This plugin is so cool and allows me to do what I want now. I just have one other suggestion for the plugin: make it so that a command or multiple commands can be run when the lottery is drawn. If this could be done, it would save me a lot of time and I think other people could put it to good use. Thanks so much for helping me and I've given you a little donation to show my appreciation.
edit: also one more little suggestion: for the maxtickets: it would be nice to put -1 to signal that there is no max number of tickets instead of putting 99999. Thanks!
edit #2: also how to do I get rid of the intervall, I want to draw them myself
edit #3: also, when the lottery is drawn and the winning player is not online, the plugin doesn't recognize that the drawing is over and it will not end until someone that is online is picked
edit #4: the range: -1 may not be working correctly. It worked fine up until the 50 generated spots for tickets were taken in the lottery.yml, but after that the plugin crashed.
edit #5: plugin crashes when the number 0 is used for the jackpot or the ticketprice
edit #6: it might be better to make all the /lottery commands have permission nodes, that way owners can take away specific permissions, for example, I don't want users to have access to the /lottery info command. Right not I just deleted all of the text in the lang.yml but it would still look nicer and be easier to just not give them a permission node.
edit #7: The generated spots don't get reset after the drawing... I'm not sure if this is a glitch but the names in the generated spots aren't reset, it doesn't count the names in the current lottery, but they still occupy spots. This is a problem because once you go over the set number of spots, the plugin gives an error (even when range: -1)
Feel free to just pick and choose things from above to put in the next update, but it would be nice to just iron out those bugs.
org.bukkit.command.CommandException: Unhandled exception executing command 'lott ery' in plugin BBLottery v1.2 at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:18 9) at org.bukkit.craftbukkit.v1_5_R2.CraftServer.dispatchCommand(CraftServe r.java:523) at net.minecraft.server.v1_5_R2.PlayerConnection.handleCommand(PlayerCon nection.java:966) at net.minecraft.server.v1_5_R2.PlayerConnection.chat(PlayerConnection.j ava:884) at net.minecraft.server.v1_5_R2.PlayerConnection.a(PlayerConnection.java :841) at net.minecraft.server.v1_5_R2.Packet3Chat.handle(Packet3Chat.java:44) at net.minecraft.server.v1_5_R2.NetworkManager.b(NetworkManager.java:292 ) at net.minecraft.server.v1_5_R2.PlayerConnection.d(PlayerConnection.java :110) at net.minecraft.server.v1_5_R2.ServerConnection.b(SourceFile:35) at net.minecraft.server.v1_5_R2.DedicatedServerConnection.b(SourceFile:3 0) at net.minecraft.server.v1_5_R2.MinecraftServer.r(MinecraftServer.java:5 80) at net.minecraft.server.v1_5_R2.DedicatedServer.r(DedicatedServer.java:2 25) at net.minecraft.server.v1_5_R2.MinecraftServer.q(MinecraftServer.java:4 76) at net.minecraft.server.v1_5_R2.MinecraftServer.run(MinecraftServer.java :409) at net.minecraft.server.v1_5_R2.ThreadServerApplication.run(SourceFile:5 73) Caused by: java.lang.NullPointerException at me.xcelsior.bblottery.LotteryManager.draw(LotteryManager.java:351) at me.xcelsior.bblottery.LotteryManager.forceDraw(LotteryManager.java:38 4) at me.xcelsior.bblottery.commands.CommandExecutor_Lottery.forceDraw(CommandExecutor_Lottery.java:192) at me.xcelsior.bblottery.commands.CommandExecutor_Lottery.onCommand(CommandExecutor_Lottery.java:77) at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ... 15 more
@Xcelsior1991
thanks~
Well, the way I used to save the tickets did not entirely survive a relog of the players or a reload of the plugin. I saved them as lists of so-called OfflinePlayers, but it seems that the Player get slightly different instances of that when one of the above happens, resulting in the players beeing able to buy additional tickets while the old ones seemed to persist but not beeing tied to the player. To be clearer: let's say you bought the maximum amount of tickets set in your config. If you tried to buy a ticket now, you would get the message that you allready got the maximum amount, as long as you do not relog or the plugin gets reloaded. If either one of those happnes, you could have bought tickets again, but somehow, the plugin would have saved the old bought tickets, but they would not be connected to you any more. If you want to try this out (in 1.2), buy a ticket, use /lottery info, it should tell you you have one ticket. now do a relog and use /lottery info again, your ticket is gone and you can buy a new ticket. If you want to see that the old tickets got preserved, set the range of tickets in the config to 0 so the tickets get given out in order, when you buy, relog and buy again you will get consecutive ticketnumbers. This bug is fixed now.