Requirements
Requirements define conditions that must be met before a player can use a voucher. All requirements must pass for the voucher to be redeemed.
Requirement Syntax
[REQUIREMENT_TYPE] value
For inverse (NOT) requirements, add !:
[!REQUIREMENT_TYPE] value
Requirement Types
PERMISSION
Requires the player to have a specific permission.
requirements:
- "[PERMISSION] cocovouchers.use.vip"
Inverse: Player must NOT have the permission:
- "[!PERMISSION] voucher.already.claimed"
WORLD
Requires the player to be in a specific world.
requirements:
- "[WORLD] world"
- "[WORLD] world_nether"
Inverse: Player must NOT be in the world:
- "[!WORLD] world_the_end"
GAMEMODE
Requires the player to be in a specific gamemode.
Values: SURVIVAL, CREATIVE, ADVENTURE, SPECTATOR
requirements:
- "[GAMEMODE] SURVIVAL"
Inverse: Player must NOT be in the gamemode:
- "[!GAMEMODE] CREATIVE"
PLACEHOLDER
Requires a PlaceholderAPI placeholder to match a condition.
Format: identifier:operator:value
Operators:
| Operator | Description |
|---|---|
>= | Greater than or equal |
<= | Less than or equal |
> | Greater than |
< | Less than |
== | Equal to |
!= | Not equal to |
requirements:
# Requires 1000+ balance
- "[PLACEHOLDER] vault_eco_balance:>=:1000"
# Requires level 10+
- "[PLACEHOLDER] player_level:>=:10"
# Requires specific rank
- "[PLACEHOLDER] luckperms_primary_group:==:vip"
Inverse: Condition must NOT be met:
- "[!PLACEHOLDER] vault_eco_balance:>=:10000"
ITEM
Requires the player to have specific items in their inventory.
Format: MATERIAL:amount or MATERIAL:amount:consume
requirements:
# Requires 64 diamonds (not consumed)
- "[ITEM] DIAMOND:64"
# Requires 32 emeralds (consumed when used)
- "[ITEM] EMERALD:32:true"
Inverse: Player must NOT have the items:
- "[!ITEM] DIAMOND_SWORD:1"
Multiple Requirements
All requirements must be satisfied:
requirements:
- "[PERMISSION] cocovouchers.use.vip"
- "[WORLD] world"
- "[GAMEMODE] SURVIVAL"
- "[PLACEHOLDER] vault_eco_balance:>=:500"
Requirement Messages
Customize messages in locale/messages_en.yml:
requirements:
no-permission: "%prefix% &cYou need the permission &e%permission% &cto use this voucher!"
has-permission: "%prefix% &cYou cannot use this voucher because you have the permission &e%permission%&c!"
wrong-world: "%prefix% &cYou must be in world &e%world% &cto use this voucher!"
wrong-world-inverse: "%prefix% &cYou cannot use this voucher in world &e%world%&c!"
wrong-gamemode: "%prefix% &cYou must be in &e%gamemode% &cgamemode to use this voucher!"
wrong-gamemode-inverse: "%prefix% &cYou cannot be in &e%gamemode% &cgamemode to use this voucher!"
placeholder-check-failed: "%prefix% &cYou need &e%value% %mode% &cfor &e%placeholder% &cto use this voucher!"
missing-item: "%prefix% &cYou need &e%amount%x %item% &cin your inventory to use this voucher!"
has-item: "%prefix% &cYou cannot have &e%amount%x %item% &cin your inventory to use this voucher!"
Use Cases
VIP-Only Voucher
requirements:
- "[PERMISSION] group.vip"
One-Time Voucher
requirements:
# Check they haven't claimed before
- "[!PERMISSION] voucher.weekly.claimed"
actions:
- "[CONSOLE] lp user %player% permission set voucher.weekly.claimed true"
- "[CONSOLE] give %player% diamond 64"
Event World Voucher
requirements:
- "[WORLD] event_world"
- "[GAMEMODE] SURVIVAL"
Economy Check
requirements:
# Requires 1000 coins minimum
- "[PLACEHOLDER] vault_eco_balance:>=:1000"
actions:
# Deduct 1000 coins
- "[CONSOLE] eco take %player% 1000"
- "[MESSAGE] &aPurchased for 1000 coins!"
Level Requirement
requirements:
- "[PLACEHOLDER] player_level:>=:30"
Item Trade Voucher
requirements:
# Requires 10 diamond blocks (consumed)
- "[ITEM] DIAMOND_BLOCK:10:true"
actions:
- "[CONSOLE] give %player% netherite_ingot 5"
GUI Editor
You can also manage requirements via the in-game GUI:
/voucher edit <name>
Click on Requirements to add, edit, or remove requirements with an intuitive interface.