• • 4/23/21 11:41 am • 1 logs
- 2.7k views • 3 today
- save_alt 143 downloads
- Compatibility
- Minecraft 1.16
- to version
- Minecraft 1.20
- Changes include
- Functions
2
Lottery
This data pack adds simple lottery system to the game. It is designed for multiplayer.
It gives a prize item (which is configurable) to the winner (Which is randomly picked from players who has tickets).
First you need a ticket, which can be obtained by using the command below:
/function lottery:give_ticketOr you can design your own lottery ticket. Just remember to put "lotteryticket:1b" custom tag to make it recognizable by data pack.
Just an advice: Don't turn your diamond sword into a ticket. The game will remove it from you after the lottery.
Sell that lottery ticket by putting it into villagers' trade offers. It'll sell tickets for your players.
Or just mix the commands to give a ticket to all players:
/execute as @a run function lottery:give_ticketNow you need a prize. There is no specific prize. Design your own prize. For example, get a Netherite Sword,, enchant it several times.Hold it as SelectedItem, (just hold it in your main hand slot) then run the command below
/function lottery:set_prizeYou can test the prize by typing:/function lottery:give_prizeNow you just need an event. If you are satisfied by the ticket count, you can launch the lottery event by typing the command below/function lottery:schedule_lotteryAfter 10 seconds, a winner will be selected and the prize will be given to him. All will lose one of their tickets.
To be eligible for the lottery, you just need to have a ticket in your inventory.
Having a ticket in ender chest does not count.
Buying multiple tickets does not increase your chance to win.
You can also launch these events periodically by using the commands below, pick the one that works for you:
/function lottery:do_every_minute/function lottery:do_every_hour/function lottery:do_every_dayNote that the first event will be launched immediately.
It is pretty simple and customizable data pack.
All commands are for the creative players. None of the commands should be executable for non-creatives.
I am planning to improve it. I appreciate criticism.
I would like to fix every undefined behavior, if exists.
1 Update Logs
Update #1 : by nejdetckenobi 04/23/2021 11:41:20 amApril 23, 2021 @ 3:41 pm UTC
Now you can launch lotteries periodically!
More like this
5078867
119


Have something to say?