Commands API
VZone Plugins / VVoucher / Items / Examples

fly-permission

A glowing feather voucher that grants temporary fly permission. This is a strong starter example for a fixed command reward with lore placeholders and multiple uses.

Material: FEATHER Usage: 2 Glow: true Action: SHIFT + RIGHT CLICK
fly-permission
fly-permission:
  Material: FEATHER
  Name: "<gradient:#1378FF:#60BFFB>Fly Permission</gradient>"
  Unbreakable: false
  Enable: true
  CustomModelData: -1
  Glow: true
  Lore:
    - ""
    - "&#1378FF????????????"
    - "  &8&l| &fUsage: &#60BFFB%current-usage%&8/&#60BFFB%max-usage%"
    - "  &8&l| &fDuration: &#60BFFB1 hours"
    - ""
    - "&#1378FF> SHIFT + RIGHT CLICK TO USE <"
  Usage: 2
  Action: "SHIFT + RIGHT CLICK"
  Command: "lp user %player% permission settemp essentials.fly true 1h accumulate"
  ItemFlags:
    - HIDE_ATTRIBUTES
    - HIDE_UNBREAKABLE

money

This voucher demonstrates the global random amount generator. The plugin rolls a value between Min and Max, then inserts the result into the command with %random-amount%.

Material: BOOK Usage: 1 Random amount TooltipStyle: global:mythic
money
money:
  Material: BOOK
  Name: "<gradient:#1378FF:#60BFFB>Money Voucher</gradient>"
  Enable: true
  Usage: 1
  Action: "SHIFT + RIGHT CLICK"
  Random:
    Min: 20000
    Max: 50000
  Command: "eco give %player% %random-amount%"
  Unbreakable: false
  CustomModelData: -1
  TooltipStyle: global:mythic
  Lore:
    - ""
    - "&#1378FF????????????"
    - "  &8&l| &fUsage: &#60BFFB%current-usage%&8/&#60BFFB%max-usage%"
    - "  &8&l| &fMoney: &#60BFFB20,000-50,000"
    - ""
    - "&#1378FF> SHIFT + RIGHT CLICK TO USE <"
  ItemFlags:
    - HIDE_ATTRIBUTES
    - HIDE_UNBREAKABLE

hdb-head-example

A compact example for HeadDatabase integration. Instead of a normal material, the item uses an HDB-<id> value directly in the material field.

Material: HDB-13376 HeadDatabase Usage: 1
hdb-head-example
hdb-head-example:
  Material: HDB-13376
  Name: "<gradient:#1378FF:#60BFFB>HDB Voucher</gradient>"
  Usage: 1
  Action: "SHIFT + RIGHT CLICK"
  Message-Chat: "{prefix} HeadDatabase voucher opened."

texture-head-example

This example uses PLAYER_HEAD together with a base64 texture string. Use this pattern when you want a custom head without depending on HeadDatabase.

Material: PLAYER_HEAD Texture: base64 Usage: 1
texture-head-example
texture-head-example:
  Material: PLAYER_HEAD
  Texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzRlOGZmMzBlMzkzNzA5ODYzN2MwYWYwM2ExZjJhNmIxN2YwZTgyOGFiMmE1N2EyNjdhMDFkYTQ4NGJhMGM1NyJ9fX0="
  Name: "<gradient:#1378FF:#60BFFB>Texture Voucher</gradient>"
  Usage: 1
  Action: "SHIFT + RIGHT CLICK"
  Message-Chat: "{prefix} Texture head voucher opened."

random-permission

The most advanced default example. It combines visual settings, multiple feedback channels, a global random range, and a weighted Random-Command list where one reward entry also uses its own local random value.

Material: ANVIL Usage: 2 Random-Command Messages enabled
random-permission
random-permission:
  Material: ANVIL
  Name: "<gradient:#1378FF:#60BFFB>Random Permission</gradient>"
  Unbreakable: false
  Enable: true
  CustomModelData: -1
  Glow: true
  Message-Chat: "{prefix} You opened a random permission voucher."
  Message-Title:
    Title: "&#1378FFRandom Permission"
    SubTitle: "&7Good luck!"
  Message-ActionBar: "{prefix}&7You opened your random permission voucher."
  Lore:
    - ""
    - "&#1378FF????????????"
    - "  &8&l| &fUsage: &#60BFFB%current-usage%&8/&#60BFFB%max-usage%"
    - "  &8&l| &fDuration: &#60BFFB1 hours"
    - ""
    - "&#1378FF> SHIFT + RIGHT CLICK TO USE <"
  Usage: 2
  Action: "SHIFT + RIGHT CLICK"
  Random:
    Min: 20000
    Max: 50000
  Random-Command:
    Command1:
      Chance: 20
      Command: "lp user %player% permission settemp essentials.fly true %local-random%h"
      Message-Chat: "{prefix} You got a &#1378FFFly &7permission!"
      Message-Title:
        Title: "&#1378FFFly"
        SubTitle: "&7Duration: &#1378FF%local-random%h"
      Message-ActionBar: "&7Reward: &#1378FFFly"
      Random:
        Min: 1
        Max: 3
    Command2:
      Chance: 20
      Command: "lp user %player% permission settemp essentials.repair true 1h"
      Message-Chat: "{prefix} You got a &#1378FFRepair &7permission!"
    Command3:
      Chance: 50
      Command: "lp user %player% permission settemp essentials.god true 1h"
      Message-Chat: "{prefix} You got a &#1378FFGod &7permission!"
    Command4:
      Chance: 40
      Command: "lp user %player% permission settemp essentials.afk true 1h"
      Message-Chat: "{prefix} You got an &#1378FFAFK &7permission!"
  ItemFlags:
    - HIDE_ATTRIBUTES
    - HIDE_UNBREAKABLE

event-example

This example demonstrates the reusable event system. The voucher itself does not define the final reward command directly. Instead, one random branch points to an external event id loaded from events/example.yml.

Material: IRON_INGOT Usage: 1 MaxStackSize: 64 External Event
event-example
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
      # This calls the external event with id: example-event
      # One reward will be selected from /plugins/VVoucher/events/example.yml
      Event: "example-event"