ModsJava
KranciVoucher - Vouchers & Pouches
Java mod listed for Minecraft 1.21–26.x. Download on the author's site.
⬇ Download on Spigot
Questions, bugs or ideas? Join our Discord: discord.gg/VeNKPKnNVD
KranciVoucher
Rewards in an item. Money, XP, items or commands - or a pouch that draws one prize from a weighted table and opens with an animation.
Free, with nothing held back. No required dependency. One jar for Paper 1.21.x and 26.x.
Rewards in an item. Money, XP, items or commands - or a pouch that draws one prize from a weighted table and opens with an animation.
Free, with nothing held back. No required dependency. One jar for Paper 1.21.x and 26.x.
A voucher is an item a player right clicks for what it holds. A pouch is the same item with several possible prizes and a reason to watch: the reel races across the row, slows down, and stops on the one they won, which is then written across their screen.
Highlights
- Vouchers and pouches - a voucher always pays what its file says; a pouch draws one outcome by weight. Both pay money, experience (points or levels), items, commands and messages, in any combination.
- An opening animation, optional per voucher - reel (icons race past and slow to a stop on the prize), flip (nothing moves, then the prize is simply there) and count-up (no window at all; the number on screen climbs to the amount won). Switch it off for one voucher and leave it on for the next.
- The prize on screen - as a title, on the action bar, in chat, or not at all, and a broadcast line for the whole server if you want one.
- Custom heads, four ways - the long base64 value from a heads site, a texture URL, a bare texture hash, player:Name, or hdb:1234 for HeadDatabase.
- Random amounts - <random:1000-5000> anywhere a number goes. The same token written twice in one voucher gives the same number, so the command that pays and the message that announces it cannot disagree. For two independent numbers, label them: <random:1-10:first>.
- Four limits, enforced in the database - uses per item (a voucher can hold three redeems and count down in its own lore), uses per player, uses server wide, and a cooldown. The check and the increment are one transaction, so on a network sharing one MySQL two players cannot both take the last of fifty.
- Where it may be used - allowed and blocked worlds, WorldGuard regions, boxes given by two corners, and a height range. Deny always beats allow, so "anywhere except the arena" is one line.
- A menu of every voucher, in folders - and the folder is the directory the file sits in, sub-folders included. Moving a voucher between folders is moving a file; there is no index to keep in sync.
- A preview with the real chances - worked out from the weights rather than typed into the lore by hand, so changing a weight changes what players are shown.
- Nothing is lost - the use is spent before the first frame is drawn, so every way an animation can end early still pays: closing the window pays at once, quitting pays from the quit handler, and a reload or a shutdown pays everyone still watching.
- A redemption log - who used what and what they got, readable in game with /voucher log, pruned on a schedule.
- SQLite out of the box, MySQL / MariaDB for networks.
- Eight example vouchers in three folders, so /voucher menu is worth opening the moment the jar is in place.
A pouch file
Code (YAML):
# vouchers/money/coin-pouch.yml -> the voucher "coin-pouch" in the folder "money"
type : pouch
item:
material : player_head
head : 'player:MHF_Question' # or base64, a texture url, a hash, or hdb:1234
name : '<gradient: #ffd34d:#ff8a00><bold>Coin Pouch</bold></gradient>'
glint : true
limits:
uses-per-item : 1
per-player : 0 # 0 = no limit
global : 0 # 0 = no limit, server wide
cooldown-seconds : 0
contents : # one of these is drawn, by weight
small:
weight : 50
icon : gold_nugget
display : '<white><random:100-400> coins'
money : '<random:100-400>'
jackpot:
weight : 5
icon : nether_star
display : '<gold><random:3000-5000> coins'
money : '<random:3000-5000>'
messages :
- ' %prefix%<gold>The jackpot! Nicely done.'
animation:
enabled : true
style : reel # reel | flip | count-up
duration-ticks : 60
notice : title # title | action-bar | chat | none
type : pouch
item:
material : player_head
head : 'player:MHF_Question' # or base64, a texture url, a hash, or hdb:1234
name : '<gradient: #ffd34d:#ff8a00><bold>Coin Pouch</bold></gradient>'
glint : true
limits:
uses-per-item : 1
per-player : 0 # 0 = no limit
global : 0 # 0 = no limit, server wide
cooldown-seconds : 0
contents : # one of these is drawn, by weight
small:
weight : 50
icon : gold_nugget
display : '<white><random:100-400> coins'
money : '<random:100-400>'
jackpot:
weight : 5
icon : nether_star
display : '<gold><random:3000-5000> coins'
money : '<random:3000-5000>'
messages :
- ' %prefix%<gold>The jackpot! Nicely done.'
animation:
enabled : true
style : reel # reel | flip | count-up
duration-ticks : 60
notice : title # title | action-bar | chat | none
Code (YAML):
type
: standard
reward:
money : '<random:250-750>'
experience : 20
display : '<gold><random:250-750> coins'
items:
- material : diamond
amount : '<random:1-3>'
- bread:16 # the short form
commands:
- 'console : lp user %player% parent add vip'
- 'player : spawn'
- 'op : gamemode creative' # operator for that one command, taken back in a finally block
messages :
- ' %prefix%<green>Enjoy.'
where:
blocked-worlds : [arena ]
blocked-regions : [spawn ]
animation:
enabled : false # this one pays the moment it is clicked
reward:
money : '<random:250-750>'
experience : 20
display : '<gold><random:250-750> coins'
items:
- material : diamond
amount : '<random:1-3>'
- bread:16 # the short form
commands:
- 'console : lp user %player% parent add vip'
- 'player : spawn'
- 'op : gamemode creative' # operator for that one command, taken back in a finally block
messages :
- ' %prefix%<green>Enjoy.'
where:
blocked-worlds : [arena ]
blocked-regions : [spawn ]
animation:
enabled : false # this one pays the moment it is clicked
- /voucher menu [folder] - every voucher on the server, by folder
- /voucher preview <voucher> - what it pays, with the real chances
- /voucher list [folder] - the same, in chat
- /voucher uses [player] <voucher> - how many are left
- /voucher give <player> <voucher> [amount] and /voucher giveall
- /voucher reset <voucher> | /voucher reset player <name>
- /voucher log [player] [count] - who used what
- /voucher reload
Permissions
- krancivoucher.use - the menu, previews and your own usage (default: everybody)
- krancivoucher.admin - give, reset, log, reload (default: operators)
Placeholders
%krancivoucher_vouchers%, %krancivoucher_folders%, %krancivoucher_used_<id>%, %krancivoucher_left_<id>%, %krancivoucher_global_<id>%, %krancivoucher_globalleft_<id>%, %krancivoucher_name_<id>%, %krancivoucher_folder_<id>%, %krancivoucher_type_<id>%, %krancivoucher_rewards_<id>%.
For developers
Code (Java):
KranciVoucherService vouchers
= Bukkit.
getServicesManager
(
).
load
(KranciVoucherService.
class
)
;
vouchers. give (player, "coin-pouch", 1 ) ;
RedeemOutcome outcome = vouchers. redeem (player, "coin-pouch" ) ;
int used = vouchers. timesUsed (player, "coin-pouch" ) ;
vouchers. give (player, "coin-pouch", 1 ) ;
RedeemOutcome outcome = vouchers. redeem (player, "coin-pouch" ) ;
int used = vouchers. timesUsed (player, "coin-pouch" ) ;
More screenshots
[ATTACH type="full" alt="KranciVoucher"]1580580[/ATTACH]
[ATTACH type="full" alt="KranciVoucher"]1580581[/ATTACH]
[ATTACH type="full" alt="KranciVoucher"]1580582[/ATTACH]
[ATTACH type="full" alt="KranciVoucher"]1580584[/ATTACH]
[ATTACH type="full" alt="KranciVoucher"]1580585[/ATTACH]
[ATTACH type="full" alt="KranciVoucher"]1580587[/ATTACH]
Tested
- 152 unit tests on the parts a player can argue with: the random tokens, the weighted roll, every combination of the four limits, the place filter, the folder tree and the animation frames.
- An in-server probe: 262 checks, then 258 more after a real restart, on Paper 1.21.1, 1.21.11 and 26.2 - including that every material and every sound key in the shipped files exists on that version, and that eight threads racing for the last of a limited voucher produce exactly one winner.
- 45 checks from a real Minecraft client holding vouchers and right clicking them, on 1.21.1 and 1.21.11.
Good to know, honestly
- Money rewards need Vault and an economy plugin. Without one the plugin says so in the console and pays nothing, rather than pretending it did.
- Region filters need WorldGuard and hdb: heads need HeadDatabase. Without them those two features are simply off and everything else works.
- A limit shared between several servers needs MySQL. On SQLite each server counts its own.
- Bedrock players need nothing extra: the menus and the animation are ordinary chest windows, which Geyser renders like any other.
- Spigot, CraftBukkit and Folia are not supported.
Support
Found a bug or have an idea? Join our Discord: discord.gg/VeNKPKnNVD
KranciVoucher exists because heymaark suggested it there - if it is useful, a review means a lot.
Quick facts
- Edition: Minecraft Java
- File type: .jar
- Minecraft versions listed: 1.21, 26.1, 26.2
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Spigot — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.
KranciVoucher - Vouchers & Pouches is a free Minecraft Java mod. Compatible with Minecraft 1.21, 26.1, 26.2, 26.3. Available via Spigot. Download it and open it directly in the game.