Changelog: 1.3 -- Added quick-and-dirty lottery pools. I'll pretty it up when I have time.
1.25 -- Added strings for the new block types from the Halloween update.
1.2 -- Added configurable costs in the format "cost id amount" (e.g., "cost 41 4" would add a cost of four blocks of gold). The default cost is still 128 dirt and 265 cobblestone, but adding a custom cost overrides that.
1.1 -- Tried to fix a bug reported by liquidox in which players would receive prizes meant for other players! Coming soon: customizable costs, perhaps a settable time limit for the command so that the entire world can't spam it.
This is a lottery mod to allow you to run a lottery that players can enter by spending 128 dirt (two stacks) and 265 cobblestone. I'm always drowning in dirt and cobble from building projects, so I wanted a fun way to spend it. There are all kinds of things in the lottery, including blocks that are hard to get naturally, like snow or water/lava blocks. Of course, some crap wins too.
This comes with a lottery-prizes.txt file that needs to be placed in your server directory; lottery-prizes.txt follows the format "PERCENT ID AMOUNT". For example, to add a prize of 64 stone with a 50 percent chance of winning it, add the line "50 1 64" to the list. Make sure that all of the percentages add up to 100; only the first 100 will be used.
If you want to change the costs, simply add (up to five) lines to the lottery-prizes.txt file specifying costs. The format is "cost ID amount," so 4 blocks of gold would be specified as "cost 41 4". Make sure that you prefix the line with "cost".
There are now quick-and-dirty lottery pools. Simply write a new file called lottery-POOLNAME in the same format as lottery-prizes and that will be a new pool. "/lottery" uses lottery-prizes.txt by default and "/lottery POOLNAME" uses a specific pool. There may be issues with large numbers of pools and/or players.
You will need to add the /lottery command to any group you wish to be able to play.