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

Localizations

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:

Donate




If you want to see it in action, you can come to my server (be warned, it is a german one, so understanding german would be an advantage ;-P):
server.block-box.org

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.

You must login to post a comment. Don't have an account? Register to get one!

  • Avatar of The_Newbizzle The_Newbizzle May 21, 2013 at 22:28 UTC - 0 likes

    does this work with 1.5.2?

    Clash of Kingdoms: The war is approaching [Game of Thrones inspired][Unique Prison/War server][Custom Plugins]

  • Avatar of Xcelsior1991 Xcelsior1991 May 20, 2013 at 21:17 UTC - 0 likes

    Ahhh, my bad, I mixed up maxTickets and range...I will implement the suggestion for maxTickets asap

    BFAK:36373,f4351bb4bb6814d6e7a2f6cb04c9484e7799f60560132de5ae96a4ebfcb5a2e3

  • Avatar of Atlas_Minecraft Atlas_Minecraft May 20, 2013 at 18:50 UTC - 0 likes

    When I set the maxtickets to -1, it told me I had the next number of tickets whenever I bought a ticket.

  • Avatar of Atlas_Minecraft Atlas_Minecraft May 20, 2013 at 18:32 UTC - 0 likes

    @Xcelsior1991: Go

    I will try setting max tickets to -1 and interval to 0; I use 1.2.1

  • Avatar of Xcelsior1991 Xcelsior1991 May 20, 2013 at 11:08 UTC - 0 likes

    @Atlas_Minecraft: Go 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: Go 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?

  • Avatar of jacobml2000 jacobml2000 May 19, 2013 at 23:55 UTC - 0 likes

    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

  • Avatar of Atlas_Minecraft Atlas_Minecraft Apr 28, 2013 at 01:03 UTC - 0 likes

    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.

    Last edited May 04, 2013 by Atlas_Minecraft
  • Avatar of PassWordE PassWordE Apr 22, 2013 at 17:24 UTC - 0 likes

    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

  • Avatar of PassWordE PassWordE Apr 22, 2013 at 17:06 UTC - 0 likes

    @Xcelsior1991: Go

    thanks~

  • Avatar of Xcelsior1991 Xcelsior1991 Apr 18, 2013 at 20:05 UTC - 0 likes

    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.

Facts

Date created
Jan 28, 2013
Category
Last update
Apr 15, 2013
Development stage
Release
Language
  • deDE
  • enUS
License
GNU General Public License version 3 (GPLv3)
Curse link
BBLottery
Downloads
926
Recent files

Authors