Repository navigation
Raffle
X-Raffle is a premium addon: timed ticket raffles with a shared pool, one random winner per round, a schedule that follows your server's day, IP-aware purchase limits, a browsable winners history, server-wide winner titles and a built-in currency sink — the winner takes their share and the rest of the pool is destroyed.
One jar, two ways to run it — the folder you drop it in decides:
| X-Prison addon | Standalone plugin | |
|---|---|---|
| Install in | plugins/X-Prison/addons/ |
plugins/ |
| Needs | X-Prison 2026.3.10.2+ with the Currency module (any server X-Prison runs on) |
Paper 1.21+, Vault and an economy plugin (EssentialsX, CMI, ...) |
| Tickets are paid in | Any X-Prison currency (credits out of the box), exact to the BigDecimal |
The Vault economy (currency: is then only the label players see) |
| Stored in | X-Prison's database (H2, SQLite or MySQL) | Its own H2 file next to the config, or MySQL (storage:) |
| Time zone, dates, countdown labels |
time: in X-Prison's config.yml
|
time: in raffle.yml
|
| Config folder | plugins/X-Prison/addons/Raffle/ |
plugins/X-Raffle/ |
Both modes use the same three config files, menus, commands, permissions and placeholders. PlaceholderAPI is optional in both.
Keep one copy of the jar (
X-Raffle-1.0.0.jar). If it sits in both folders, the standalone plugin copy runs and the addon copy stands down with a console message.
Renamed from "Raffle". Earlier builds used
xprison.raffle.*permissions, thexprisonraffleplaceholder identifier andxprison_raffle_*tables. The permissions are nowxraffle.*, the placeholders%xraffle_…%(%xprisonraffle_…%keeps working as an alias) and the tablesxraffle_*. As an addon the config folder is stillplugins/X-Prison/addons/Raffle/.
As an X-Prison addon — drop the jar into plugins/X-Prison/addons/ and restart. X-Prison loads it
through the jar manifest; it never appears in /plugins on its own. The default currency is
credits (see Currency).
As a standalone plugin — drop the jar into plugins/ next to Vault and your economy plugin and
restart. The H2 driver and the connection pool are downloaded by the server itself (libraries in
plugin.yml), so nothing else has to be installed. Standalone mode needs Paper: it renders
MiniMessage through the Adventure library Paper ships. On Spigot, run it as an X-Prison addon.
- A round opens and is announced to everyone. Its length is decided by the local time it starts at
(
schedule.bands): out of the box 1h from 15:00, 2h from 19:00 and 3h from 23:00, read in the global time zone —time.timezonein X-Prison's config.yml as an addon,time.timezoneinraffle.ymlstandalone. Bands wrap around midnight, so the last band applies until the first. - Players buy tickets from
/raffleor with/raffle buy <amount>. Every ticket is one entry. - Reminders are broadcast at the configured marks before the draw (
10m,5m,1m). - When every ticket is sold, entries close ("Sold out") but the draw still happens on schedule.
- When the timer ends the round is drawn — unless fewer than
quiet-rounds.minimum-ticketswere sold. Then it is extended byextend-by, announced, up tomax-extensionstimes, and drawn with whatever was sold after that. - One ticket is drawn at random. Its owner instantly receives
winner-share-percentof the pool, gets a personal title and message, and everyone online sees the winner broadcast and title. The remainder of the pool is destroyed. - After
break-between-roundsthe next round opens.
A round with no tickets closes without a winner. A round that ended while the server was down is drawn on the next start with whatever was sold. A prize that could not be paid (for example the currency was missing) is paid on the next start.
Written to the config folder (plugins/X-Prison/addons/Raffle/ as an addon, plugins/X-Raffle/
standalone) on first start. Files are only written when missing, so your edits are never
overwritten; a setting added by an update falls back to the bundled default and is named once in
the console.
| File | Holds |
|---|---|
raffle.yml |
Switch, currency, command labels, permissions, ticket price / capacity / winner share, limits, schedule, quiet rounds, reminders, history size, every announcement, the winner's personal effect, small sound cues and — standalone only — time: and storage:. |
raffle-gui.yml |
The main menu, the winners menu and the purchase confirmation. |
raffle-messages.yml |
Every chat line. All MiniMessage (legacy & codes work too). |
currency: creditsAs an addon this is the internal name of an X-Prison currency. X-Prison 2026.3.10.2 ships
credits as a default currency on fresh installs; a server upgraded from an older version has to
paste the credits: block from currencies.yml (the config updater never touches
the currency list) or point this at tokens, money, gems or any currency it already has. While
the currency does not exist the console says so at startup, nobody can buy a ticket and no round
opens; fix it and run /raffle reload.
Standalone every ticket and prize goes through the Vault economy, and currency: is only the
label players see in menus and messages.
tickets:
price: 10
capacity: 5000
winner-share-percent: 70
limits:
max-per-person: 500
count-alts-by-ip: true
confirm-from: 100-
price,capacityandwinner-share-percentare copied into a round when it opens, so a reload never changes a live round's money.max-per-personis read live. -
count-alts-by-ip: truecounts every account that bought from the same connection this round against one sharedmax-per-person.xraffle.bypass.altscounts a player on their own account only;xraffle.bypass.limitignores the personal cap (capacity still applies). - Purchases of
confirm-fromtickets or more open a confirmation menu. Shift-click ("buy the maximum") always asks.
schedule:
break-between-rounds: 5m
fallback-duration: 1h
bands:
- from: '15:00'
duration: 1h
- from: '19:00'
duration: 2h
- from: '23:00'
duration: 3hA round's length is the duration of the band whose from is the latest one at or before the local
time the round starts. Durations are elapsed time, so daylight-saving changes never stretch a round.
With an empty list every round lasts fallback-duration.
The "Rounds run 1h from 15:00 ..." line of the info item in
raffle-gui.ymlis plain lore (its%timezone%shows the global zone). Update it when you change the bands.
quiet-rounds:
minimum-tickets: 100
extend-by: 30m
max-extensions: 4
reminders:
remind-at: [10m, 5m, 1m]Times accept 30s, 5m, 1h30m, 1d. A reminder longer than the round (or the extension) it
belongs to is skipped rather than fired the moment the round opens.
Every key under announcements: (round-open, reminder, extension, sold-out, winner,
no-winner, cancelled) has the same shape:
winner:
enabled: true
broadcast: "<gold><bold>RAFFLE</bold> <yellow>%winner% <gray>won <green>%prize% %currency% ..."
title:
enabled: true
title: "<gold><bold>RAFFLE WINNER</bold>"
subtitle: "<yellow>%winner% <gray>won <green>%prize% %currency%"
fade-in: 1
stay: 4
fade-out: 1
sound:
enabled: true
sound: ENTITY_PLAYER_LEVELUP
volume: 1.0
pitch: 1.0Broadcasts go to every online player with the message prefix. Sounds accept both ENTITY_PLAYER_LEVELUP
and entity.player.levelup; an unknown name is logged once and silenced. winner-personal is the
title and sound the winner alone receives, and effects.purchase / denied / menu-open / click
are the small cues for the acting player (click is the button sound).
Placeholders: %round% %pool% %prize% %sold% %capacity% %remaining% %time-left% %next-opens-in% %duration% %price% %currency% %extend-by% %extensions% %max-extensions%, plus %winner% %tickets% %total-tickets% %chance% for the winner.
As an X-Prison addon both sections are ignored: the time zone, date format and countdown labels come
from time: in X-Prison's config.yml, and everything is stored in X-Prison's database.
time:
timezone: "" # IANA id, e.g. Europe/Berlin. Empty = the server's system zone
date-format: "yyyy/MM/dd HH:mm:ss" # winners menu and /raffle history
duration-units:
day: "d"
hour: "h"
minute: "m"
second: "s"
separator: " "
storage:
type: h2 # h2 = raffle.mv.db next to the config; mysql = shared database
mysql:
host: localhost
port: 3306
database: minecraft
username: root
password: ""
pool-size: 8
use-ssl: falseChanging storage.type needs a restart.
raffle-gui.yml ships the reference layout: a 3-row menu with grey glass filler, the rules paper in
slot 0, the buy emerald in slot 11, the live current-raffle ender chest in slot 13 (replaced by
no-round between rounds), the winners clock in slot 15 and a close barrier in slot 22.
- Items accept
material,name,lore,custom_model_data,glowandhead-texture(base64). Any menu accepts adecorations:block of extra non-clickable items. Custom item ids (ItemsAdder, Nexo, Oraxen) resolve through X-Prison, so they need the addon install; standalone knows vanilla materials andhead-texture. -
menu.refresh-secondsis how often the countdown redraws (0disables live refresh). -
buy.left-click-amount/right-click-amountandcurrent.click-amountset how many tickets a click buys. -
gui.status.*are the fragments%status%shows per state. -
winners-menupaginates the history overcontent-slotswith player heads;confirmis the purchase confirmation with a preview item.
Static placeholders work everywhere: %price% %max-per-person% %capacity% %winner-share% %currency% %break% %timezone% %minimum-tickets% %extend-by% %max-extensions%. Round placeholders:
%round% %status% %pool% %pool_long% %prize% %prize_long% %your-tickets% %chance% %sold% %remaining% %time-left% %next-opens-in% %extensions% %last-winner% %last-prize%.
| Command | Permission | Does |
|---|---|---|
/raffle |
permissions.use (blank = everyone) |
Opens the raffle menu. |
/raffle <player> |
permissions.open-other |
Opens the menu for another online player. |
/raffle buy <amount> |
use | Buys tickets (confirmation from confirm-from). |
/raffle winners [player] |
use (open-other for another player) |
Opens the winners history. |
/raffle help |
use | Lists what the sender may run. |
/raffle start |
admin | Opens a round now. |
/raffle draw |
admin | Draws the current round now (ignores the quiet minimum). |
/raffle cancel |
admin | Cancels the round and refunds every ticket. |
/raffle extend <time> |
admin | Pushes the draw back; does not count as a quiet-round extension. |
/raffle info |
admin | Round, pool, sales, time left, last winner. |
/raffle history [page] |
admin | Winners in chat, 10 per page. |
/raffle give <player> <amount> |
admin | Adds free tickets (nothing added to the pool). |
/raffle take <player> <amount> |
admin | Removes tickets (no refund). |
/raffle reload |
admin | Re-reads all three files. As an addon, /xprison reload and /xprison reload Raffle do the same. |
The command name and its aliases (raffle, raffles, lottery out of the box) come from
command.labels and change on reload in both modes.
| Permission | Grants |
|---|---|
xraffle.admin |
The admin subcommands. |
xraffle.menu.other |
Opening the menus for another player. |
xraffle.bypass.alts |
Own-account counting only. |
xraffle.bypass.limit |
No personal cap. |
Every node is configurable under permissions: (use, admin, open-other, bypass-alts,
bypass-limit; blank open-other disables opening menus for others). The standalone plugin
declares the nodes in plugin.yml: admin and menu-other default to op, the bypasses to nobody.
Requires PlaceholderAPI. Identifier xraffle; xprisonraffle still works as an alias, so
%xprisonraffle_pool% and %xraffle_pool% give the same value.
| Placeholder | Gives |
|---|---|
%xraffle_round% |
Current round number (last round while closed) |
%xraffle_status% / _status_raw
|
Status fragment / OPEN EXTENDED SOLD_OUT DRAWING CLOSED
|
%xraffle_pool% / _pool_raw
|
Pool, formatted / plain |
%xraffle_prize% / _prize_raw
|
Winner's share of the pool |
%xraffle_sold% _capacity _remaining
|
Ticket counts |
%xraffle_time_left% _next_opens_in
|
Countdowns |
%xraffle_tickets% _chance
|
The viewer's tickets and win chance |
%xraffle_price% _max_per_person _currency
|
Static settings |
%xraffle_last_winner% _last_prize _last_round
|
Most recent winner |
Tables xraffle_rounds, xraffle_tickets and xraffle_winners — in X-Prison's database (H2,
SQLite or MySQL) as an addon, in raffle.mv.db (H2) or the configured MySQL database standalone.
Amounts are stored as text so OP-scale values stay exact. A ticket is written before the purchase is
final and refunded on the spot if the write fails.
Through Vault (standalone) the economy plugin counts in doubles, so balances beyond about 9,000,000,000,000,000 lose precision there. As an X-Prison addon amounts stay exact.
Package dev.drawethree.xprison.raffle.api.event (inside the jar). Every event exposes
getRound() — a snapshot of the round. They fire in both install modes.
| Event | Cancellable | Notes |
|---|---|---|
RaffleTicketPurchaseEvent |
yes |
getPlayer(), getAmount() / setAmount(int), getCost(). A changed amount is re-validated. |
RaffleRoundStartEvent |
no | Fired when a round opens. |
RaffleDrawEvent |
no |
getWinner(), getWinnerName(), getPool(), getPayout(), getWinnerTickets(), getTotalTickets(). |
RaffleRoundCancelEvent |
no |
getRefundedPlayers(), getRefundedTotal(). |
@EventHandler
public void onDraw(RaffleDrawEvent event) {
getLogger().info(event.getWinnerName() + " won " + event.getPayout().toPlainString());
}-
"No currency named 'credits' is registered" (addon) — add the currency to
currencies.ymlor changecurrency:inraffle.yml, then/raffle reload. -
Menus show "10$ $" (standalone) — some economy plugins (EssentialsX) report only a symbol as
their currency name; X-Raffle then shows your
currency:label instead. Set it to the name you want players to see. -
"Standalone X-Raffle needs Paper" on Spigot — standalone mode needs Paper. On Spigot, install
the jar in
plugins/X-Prison/addons/instead. -
"X-Raffle is also installed in plugins/, so this addon copy stands down" — the same jar is
also in
plugins/. Keep one copy: delete it fromplugins/to run on X-Prison currencies, or fromaddons/to run standalone. -
The info item still says "1h from 15:00" after I changed the bands — that line is plain lore;
edit it in
raffle-gui.yml. - A reminder never fires — reminders longer than the round or the extension are skipped on purpose.
-
"Unknown sound" — the name is not in the sound registry; use the enum name or the
namespace.keyform.
Since 1.1.0 the addon follows each player's /xprison language
(X-Prison 2026.3.15.1+). German, Spanish, French and Brazilian Portuguese are included for raffle.yml, raffle-gui.yml and raffle-messages.yml.
Only as an X-Prison addon on X-Prison 2026.3.15.1+: on an older core, or as a standalone plugin, everything stays as written in your files.
Your edited lines always win. To change a translation, write the line in
plugins/X-Prison/lang/addons/Raffle/<language>/<same file name> - see Translations.
- Home
- Features
- Setup
- Commands & Permissions
- Placeholders
- Logging
- Season Reset
- Translations
- Item Models & Tooltips
- Changelog
- Currencies
- Ranks
- Prestiges
- Rebirths
- Mines
- AutoSell
- AutoMiner
- Enchants
- Pickaxe Levels
- Pickaxe Skins
- Pickaxe Quality
- Pickaxe Settings
- Gangs
- Multipliers
- Blocks
- Bombs
- History
- Mining Stats
- Nicknames
- Battle Pass
- Quests
- Daily Rewards
- Milestones
- Leaderboards
- Boosters
- config.yml
- autominer.yml
- autosell.yml
- block-rewards.yml
- enchants.yml
- currencies.yml
- multipliers.yml
- ranks.yml
- prestiges.yml
- pickaxe-levels.yml
- pickaxe-skins.yml
- pickaxe-quality.yml
- gangs.yml
- mines.yml
- bombs.yml
- blocks.yml
- history.yml
- logging.yml
- mining-stats.yml
- rebirths.yml
- battlepass.yml
- quests.yml
- dailyrewards.yml
- milestones.yml
- leaderboards.yml
- boosters.yml
- efficiency.json
- fortune.json
- unbreaking.json
- haste.json
- speed.json
- fly.json
- nightvision.json
- jumpboost.json
- autosell.json
- tokenfinder.json
- gemfinder.json
- salary.json
- charity.json
- blessing.json
- gangvaluefinder.json
- prestigefinder.json
- explosive.json
- nuke.json
- layer.json
- laserbeam.json
- second-hand.json
- sixth-hand.json
- doomfall.json
- prism-break.json
- gem-merchant.json
- token-merchant.json
- super-token-miner.json
- double-strike.json
- prodigy.json
- blockbooster.json
