Any player puts up a prize, everybody enters, one winner is drawn

GIVEAWAYS
Any player puts up a prize, everybody enters, one winner is drawn
free · one plugin · fully configurable
A player says "I am giving away 50000, entries close in ten minutes". The money leaves their balance right then, sits in the giveaway until the deadline, and one entrant is drawn at random and paid. An item giveaway is the same thing with the stack the host is holding.
Every player may start one, not only staff — that is what this plugin is for, and it decides everything else about it. If the prize were only a promise, the most ordinary case there is would break it: the host logs out, spends the money or drops the item, and the people who entered are told there is a winner and no prize. So the prize is taken at the start and held until somebody is handed it.
Drop in the jar, start the server. /giveaway start 10m 50000 and it is running.
What it does
- Anybody may host one — the permission to start a giveaway is on for everybody out of the box, with limits that keep it from turning into an advertising channel
- Money or the item in your hand — /giveaway start 10m 50000, or /giveaway start 1h hand for the stack you are holding
- A list of what is running, the one drawn next at the front, with the countdown moving once a second
- One click to enter, on the giveaway's own screen — the host is refused, and so is a second entry
- Chat announcements when one starts, when it is nearly over, and who won — each one a line you can blank
- Drawn whether you are online or not — money lands in the balance, an item waits and is handed over on your next join
- Nobody entered — the prize goes back to the host, and you can require more than one entrant before it counts as a draw at all
- Limits that matter — how many per player and per server, shortest and longest run, smallest prize, and a cooldown between two
- Placeholders — %skgiveaways_*% for a board at spawn: what is running, what is drawn next, what is waiting for a player
Why the prize is taken at the start
Money leaves the host's balance, and an item leaves their hand, in the same call that creates the giveaway. Nothing is checked again later because there is nothing left to check: the winner is paid out of a prize that already left its owner.
Two rules follow from that, and both are deliberate. The host may not enter their own giveaway — they staked the prize, and with a second account it would be a way of looking generous for free. And the host may not cancel once somebody has entered: everyone in that list entered on the strength of a prize that was already staked, so a host who can pull it back after seeing who is in there can also run giveaways that never pay out. Before the first entry there is nobody to let down, so that is always allowed. Staff may cancel at any time, and the prize goes back to the host either way. One setting opens cancelling up for everybody if your server would rather have it that way.
An item that cannot be written down safely is refused instead of staked, and nothing is taken from the host. Enchantments, a custom name, lore and another plugin's data on the stack all survive to the draw — the prize is the item, not a material name.
A restart does not end a giveaway
- The deadline is a point in time, not a countdown — a server that was down for an hour comes back to a giveaway that has already ended and draws it at once, instead of quietly restarting everyone's clock
- Anything that moves a prize is written immediately — started, drawn, cancelled. Entries are collected once a second, so a hundred people clicking at the same moment is one write and not a hundred
- One way out, and it only works once — the draw at the deadline, a staff member drawing it early and a cancel in the same tick all go through the same single step, and whoever gets there first is the only one who hands anything out
- A record it cannot read is never deleted — behind every one of them is a prize somebody already paid, so it stays on disk untouched and is written into the console
- A payout that is refused stops the draw — with no economy available at that moment the giveaway stays open, is retried a minute later and the console says why. Better a giveaway that ends late than a winner who is handed nothing
The limits
Everything here exists because anybody may start a giveaway. A server where one player can open thirty of them has a spam channel, not a giveaway feature.
- One giveaway per player and twenty on the server at a time — both switched off with a 0
- Thirty seconds to seven days. The minimum matters more than it looks: a five-second giveaway is a way of handing a prize to whoever happens to be reading chat
- At least 100 for a money prize, with no upper end unless you set one
- Five minutes between two — the most effective setting of the lot, because a per-player limit only counts what is still running
- A rank can be given more with skgiveaways.limit.<number>, and the highest number a player holds wins — no second config file for donor ranks
- Entrants are unlimited by default and one is enough for a draw; both are a number you set
- A blacklist of what may not be staked. Containers are on it out of the box: a shulker box full of goods is a prize whose real contents nobody in the menu can see
Staff can be given a permission that ignores the per-player limit, the server limit and the cooldown.
Requirements
- Bukkit, Spigot, Paper or Folia — 1.21 up to the current release
- Java 21 or newer
- Vault and an economy plugin only for money prizes. Without one the plugin still loads and runs item giveaways, and says why a money giveaway is refused instead of quietly not being there
- PlaceholderAPI only if you want the placeholders
Built against the Spigot API, so nothing in it can quietly depend on Paper. Tested on CraftBukkit 1.21.1, Spigot 1.21.1, Paper 1.21.1, Paper 26.2 and Folia 26.2.
Commands and permissions
- /giveaway the list — aliases /giveaways and /ga, full name /skgiveaways
- /giveaway start <time> <amount|hand> stake money, or the stack in your hand
- /giveaway join <id> enter one
- /giveaway info <id> one line about one giveaway
- /giveaway cancel <id> take your own back
- /giveaway claim collect what you won while you were away
- /giveaway list everything running, in chat
- /giveaway end <id> draw one now (staff)
- /skgiveaways reload reload the configuration
skgiveaways.use, skgiveaways.create and skgiveaways.broadcast belong to everybody, skgiveaways.bypass-limit and skgiveaways.admin to operators. Take broadcast away from a rank and its players stop seeing the announcements without anything else changing.
Configuration
- settings.yml the limits, what may be staked, the announcements, the sounds, storage and every message
- menu-giveaways.yml the list, slot by slot — how many fit on a page is simply how many slots you draw
- menu-giveaway.yml one giveaway: the prize, who put it up, and the way in
- English and German both ship with it — one line in config.yml switches over, comments included
Every setting is commented: what it does, and why the default is what it is. A reload leaves running giveaways alone. Their deadline, their entrants and their prize are already fixed, and applying a new minimum duration to a giveaway somebody has entered would be changing the deal after the fact — new rules apply to the next one.
Where the data lives
The running giveaways and the prizes waiting to be collected. One setting decides: a plain YAML file (the default, readable and fixable by hand), SQLite, or MySQL when several servers should share one list. Nothing to install for any of them. If the database cannot be reached it falls back to YAML and says so in the console, rather than starting without anybody's prize.
Built to be left alone
An open menu redraws itself once a second while somebody is looking at it, and the timer stops when the screen closes — including for a player who is kicked and whose menu never raises a close event. The sweep behind the countdowns is one time comparison per running giveaway, and running giveaways are capped by a setting.
Folia-ready: the draw runs on the global region, and everything that touches a player — the winner's message, the item put aside for them, an announcement — hops onto that player's own region first.
No strings attached
No licence key, no whitelist, no phone-home, no statistics. The only connection it ever opens is to your own MySQL server, and only if you switch storage over. Free to use and to rebrand on as many servers as you like.
Support
Discord: discord.gg/cJDH38CUtu
If it works for you, following the project means a lot.
Information
Pinned Versions
- R1.21–26.2
Pages
Members
1Owner