VVOUCHER
Voucher System
This page explains how vouchers are structured, what each option means, how reusable event tables fit into the reward flow, and how placeholders behave at runtime.
Voucher Format
Each top-level key in a voucher YAML file is a voucher id.
money:
Material: PAPER
Name: "<gradient:#1378FF:#60BFFB>Money Voucher</gradient>"
Usage: 1
Action: "SHIFT + RIGHT CLICK"
TooltipStyle: global:mythic
Random:
Min: 20000
Max: 50000
Command: "eco give %player% %random-amount%"
Voucher Options
| Option | Meaning |
|---|---|
Material | Bukkit material name for the item. |
Material: HDB-12345 | Uses a HeadDatabase head id as the voucher item. |
Name | Display name of the item. |
Texture | Optional base64 texture. Only works with Material: PLAYER_HEAD. |
Lore | Lore lines shown on the item. |
Unbreakable | True or false. |
CustomModelData | Set -1 to disable. |
TooltipStyle | Optional namespace:path tooltip style, only applied on Minecraft 1.21.2+. |
MaxStackSize | Optional per-item max stack size. Use -1 or leave it out to disable it. |
Glow | True or false. |
Usage | How many times the voucher can be used before it is removed. |
Enable | Optional true or false. Defaults to true if missing. |
Action | Required interaction type that triggers the voucher. |
Command | Console command executed on use. |
Message-Chat | Optional chat message on voucher use. |
Message-Title | Optional title and subtitle on voucher use. |
Message-ActionBar | Optional action bar message on voucher use. |
Random-Command | Weighted random command list. |
Event | Inside a random reward entry, calls a reusable external event table from events/*.yml. |
Random.Min / Random.Max | Voucher-level random range for %random-amount%. |
Attributes | Optional item attributes. |
Enchantments | Optional item enchantments. |
ItemFlags | Optional item flags. |
Potion | Optional potion effect applied to the player. |
Option Examples
Each option below includes a practical YAML snippet so you can see how it looks in a real voucher file.
Material
fly-permission:
Material: FEATHERMaterial: HDB-12345
hdb-head-example:
Material: HDB-13376Name
money:
Name: "<gradient:#1378FF:#60BFFB>Money Voucher</gradient>"Texture
texture-head-example:
Material: PLAYER_HEAD
Texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzRlOGZmMzBlMzkzNzA5ODYzN2MwYWYwM2ExZjJhNmIxN2YwZTgyOGFiMmE1N2EyNjdhMDFkYTQ4NGJhMGM1NyJ9fX0="Lore
money:
Lore:
- ""
- "բFF????????????"
- " &8&l| &fMoney: <BFFB20,000-50,000"Unbreakable
fly-permission:
Unbreakable: falseCustomModelData
money:
CustomModelData: -1TooltipStyle
money:
TooltipStyle: global:mythic- Optional and only applied on Minecraft
1.21.2+. - The value must use
namespace:pathformat. - Minecraft stores it as the
minecraft:tooltip_styledata component. - The client resource pack needs
assets/<namespace>/textures/gui/sprites/tooltip/<path>_background.pngand.../<path>_frame.png. - If the textures are missing, Minecraft shows the missing texture.
- Invalid values are skipped with a console warning because Bukkit only accepts valid
NamespacedKeyvalues.
MaxStackSize
event-example:
MaxStackSize: 64- Optional.
- If it is missing, the voucher uses the normal item stack behavior.
- If it is set to
-1, VVoucher does not override the stack size. - If the running server version does not support custom item max stack size, the plugin safely skips it.
Glow
fly-permission:
Glow: trueUsage
fly-permission:
Usage: 2Enable
money:
Enable: trueAction
money:
Action: "SHIFT + RIGHT CLICK"Command
money:
Command: "eco give %player% %random-amount%"Message-Chat
random-permission:
Message-Chat: "{prefix} You opened a random permission voucher."Message-Title
random-permission:
Message-Title:
Title: "բFFRandom Permission"
SubTitle: "&7Good luck!"Message-ActionBar
random-permission:
Message-ActionBar: "{prefix}&7You opened your voucher."Random-Command
random-permission:
Random-Command:
Command1:
Chance: 20
Command: "lp user %player% permission settemp essentials.fly true 1h"
Command2:
Chance: 80
Command: "eco give %player% 500"Event
event-example:
Random-Command:
Command1:
Chance: 50
Event: "example-event"Random.Min and Random.Max
money:
Random:
Min: 20000
Max: 50000Attributes
tank-voucher:
Attributes:
GENERIC_ARMOR:
Value: 20
EquipmentSlot: HANDEnchantments
enchanted-voucher:
Enchantments:
DURABILITY: 3ItemFlags
money:
ItemFlags:
- HIDE_ATTRIBUTES
- HIDE_UNBREAKABLEPotion
strength-voucher:
Potion:
Type: "STRENGTH"
Level: 2
Duration: 90Supported Actions
Command Placeholders
%player%%uuid%%random-amount%%local-random%inside random reward entries that define a localRandom%current-usage%%max-usage%
PlaceholderAPI placeholders are also supported in voucher names, lore, messages, commands, and random reward commands or messages.
Voucher Use Messages
random-permission:
Message-Chat: "{prefix} Nyitottál egy random permissiont."
Message-Title:
Title: "բFFRandom Permission"
SubTitle: "&7Sok szerencsét!"
Message-ActionBar: "{prefix}&7Megnyitottad a random permission voucheredet."
Random-Command
event-example:
Material: IRON_INGOT
Name: "<gradient:#1378FF:#60BFFB>Event Example Voucher</gradient>"
Usage: 1
Action: "SHIFT + RIGHT CLICK"
MaxStackSize: 64
Random-Command:
Command1:
Chance: 50
Message-Chat: "{prefix} You got nothing!"
Command2:
Chance: 50
Event: "example-event"
- Each entry id can be any name.
Chanceis required.Commandis required unless the reward usesEvent.- Message fields are optional.
Eventis optional and can call a reusable reward table fromevents/*.yml.Randomis optional and belongs only to that reward entry.- Total chance does not need to equal
100. - Higher
Chancemeans higher selection weight. - If
Random-Commandexists, it takes priority over normalCommand. - If a reward uses
Event, VVoucher selects one reward from that external event table. %local-random%only exists inside the selected random reward entry.%random-amount%still refers to the voucher-level random section.
Events Folder
You can create reusable weighted reward tables inside plugins/VVoucher/events/.
example-event:
reward-1:
Chance: 20
Command: "give %player% diamond 1"
Message-Chat: "{prefix} You got a բFFdiamond&7!"
reward-2:
Chance: 10
Command: "give %player% diamond 2"
reward-3:
Chance: 70
Command: "give %player% iron_ingot 1"
- Each top-level key is an event id.
- Event rewards need
Chanceand normallyCommand. - Event rewards support
Message-Chat,Message-Title,Message-ActionBar, and localRandom. - Event rewards do not support nested
Eventcalls.
HeadDatabase and Custom Heads
random-permission:
Material: HDB-127387
Name: "<gradient:#1378FF:#60BFFB>Random Permission</gradient>"
random-permission:
Material: PLAYER_HEAD
Texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZjYwY2Y0ZGJmY2NiODg1YTNkNmVkZGIwZDE3ZDFhMDMxNTkxOGUxZTcyYTJkZDg1Njk0OTE5MTNjOWI2MzUxZSJ9fX0="
Name: "<gradient:#1378FF:#60BFFB>Random Permission</gradient>"
HDB-<id>treats the material as a HeadDatabase head.Textureonly works withMaterial: PLAYER_HEAD.- If HeadDatabase is missing, HDB materials cannot be created correctly until it is installed.
Identification and Vanilla Blocking
Voucher items are identified with persistent data, not by display name or lore. Internal marker format:
vvouchers:%config-key%
This means the plugin can still recognize the voucher even if the item is renamed visually, as long as the stored metadata remains intact.
Language System and Error Handling
config.yml controls the active language. Example:
language: en
This loads plugins/VVoucher/lang/en.yml. You can switch to Hungarian with language: hu.
For normal configuration mistakes, the plugin tries to print a readable warning instead of a useless stack trace:
[Config Error] example.yml -> money.Material: Unknown material: PAPERR