🤑 Lottery 🤑


Can you add sqlite / mySQL support and track the top lottery wins? aswell as a /lottery top to see who won the biggest pools


For tracking the biggest, let's say 5, pots, a config file is okay. For tracking all pots a database is a good idea. But why would you track all pots?


For getting a ranking to display on menus/scoreboards etc


I think only a small amount like 5 or 10 biggest pots should be saved. Nobody is interested in the other ones. I would save them in the config because that's really not a lot of data.
/lottery top could display who won the pot in descending pot order.

Do you want an external plugin to be able to access the data?


Yes it will be used by an external plugin to pull data from Lottery, and this information can be used to display a persons ranking, highest lottery pot won, highest lottery pot won on the server etc, i'm looking at it more with the Placeholders plugin and these placeholders can be used anywhere, holograms, books, bossbar, menus, etc


If your are already developing an external plugin then the most generic way I could do it would be just firing an LotteryDraw event. You plugin has the lottery plugin as a dependency(the most simple way is jitpack) and has registered an event listener for the lottery event. The event will provide useful information. Your plugin then may do its things with the data, like storing it in a database.

"But the 10 highest pots"-command may be added to the lottery plugin anyway. :wink:


Hey, my Lottery announcer is shooting this weird message when it draws the winner...


The custom message in the config seems to be not formatted in the right way. I guess you can fix it by putting quotes around the value of text, so "won the lottery pot of". If that doesn't work please upload your config on Pastebin and post a link here.


Will this be updated to SpongeForge API6?


http://pastebin.com/LtLHuWKs It is in quotes, please check Pastebin


That formatting is wrong. It should look like this, an example:

serverName="My Sponge Server"
mytemplate {
    arguments {
        player {
        server {
    content {
            "Welcome to ",
            " ",
    options {

I am working on an easier way to format text templates.

@Brosia Once the official version is released, yes. The plugin for api v5 may work with the current snapshots of api v6. Just try it with a backup of your world.


Is there any kind of admin command for giving x amount of tickets to a player? or could this be added?


In this case you can modify the config manually:

# Don't modify this!
internal-data {
    bought-tickets {
        <PlayerUUID> = <numberOfTickets>,
        <PlayerUUID> = <numberOfTickets>
    pot = 0


# Don't modify this!
internal-data {
    bought-tickets {
        "069a79f4-44e9-4726-a5be-fca90e38aaf5" = 12,
        "e63cec43-38f5-41d0-b7f3-8593ae0c862f" = 42
    pot = 0

Also it would be good to add money to the pot :wink:

I didn't create a command for doing this automatically because I can't think of an use case. Why do you want it?


I want to hook it into a few different things; each vote would give the player 1 ticket, at the end of the month pot is rolled and winner gets it. on the off chance this wasnt the route my guys were wanting to go and instead do it based on quest completion then manually editing the file would also be somewhat of an annoyance, but those are my reasoning.


You can load the config of this plugin by your custom plugin to modify it, it is a clean solution because the config gets never cached in this plugin.
The other way I could propose is adding a public method that gets called by your plugin. Therefore you would have to add this plugin as a dependency to yours(e.g. by using jitpack).
Well, and adding a command is also an option but I don't like that much. I am currently busy doing other things, so updates won't come that fast. The first method would work without any updates.


Can't use lottery info from console - it should at least inform how much is in the pot and how many time left.


Ah, good point! I'll add it in the future!


Moved to Ore: https://ore.spongepowered.org/RandomByte/Lottery

I released there a new version of this plugin.



Hi could you make the following changes to make the plugin better:

Add price of a ticket to /lottery info so players know how much they are spending. Takes price from config.

When not enough funds, instead of "Transaction Failed", show "You need (price of ticket)"

Also, saving the current pot after server restarts would be great, if possible.



On my list.