VZone Plugins/VVoucher/Configurations/vouchers/example.yml

Config

example.yml
# ============================================================
# VVoucher example voucher file
# ============================================================
#
# You can create as many .yml files as you want inside:
# /plugins/VVoucher/vouchers/
#
# Every top-level key is a voucher id.
# Example:
#   fly-permission:
#   money:
#   rank-voucher:
#
# The voucher id is used by:
# - /vvoucher give <voucher-name>
# - the internal NamespacedKey marker: vvouchers:%config-key%
#
# Important:
# Items created by this plugin do NOT keep their normal vanilla behavior.
# Example:
# - block materials cannot be placed
# - usable materials like ender pearl, eye of ender, firework, food, etc. cannot be used normally
# They only work through the configured voucher Action.
#
# ============================================================
# Supported click actions
# ============================================================
#
# - RIGHT CLICK
# - LEFT CLICK
# - MIDDLE CLICK
# - SHIFT + RIGHT CLICK
# - SHIFT + LEFT CLICK
# - SHIFT + MIDDLE CLICK
# - HAND SWITCH
# - SHIFT + HAND SWITCH
#
# ============================================================
# Optional settings inside a voucher
# ============================================================
#
# Material:
#   Bukkit material name. Example: PAPER, FEATHER, DIAMOND
#   You can also use:
#   - HDB-12345
#     This will use HeadDatabase head id 12345 as the voucher item.
#
# Name:
#   Display name of the item.
#   Supports MiniMessage, hex colors and legacy colors.
#   PlaceholderAPI placeholders are parsed for the player who receives/views the item.
#
# Texture:
#   Optional.
#   Only works if Material is PLAYER_HEAD.
#   Lets you use a custom base64 texture without HeadDatabase.
#
# Lore:
#   List of lore lines.
#   Supports placeholders such as %current-usage% and %max-usage%.
#
# Unbreakable:
#   true / false
#
# CustomModelData:
#   Set to -1 to disable.
#
# Glow:
#   true / false
#
# Usage:
#   How many times the voucher can be used before it disappears.
#   Default is 1.
#
# Enable:
#   Optional true / false value.
#   If missing, the voucher is treated as enabled by default.
#   Disabled vouchers cannot be given or used through normal plugin commands.
#
# Action:
#   Which interaction must trigger the voucher.
#
# Command:
#   Console command executed when the voucher is used.
#   Supported placeholders:
#   - %player%
#   - %uuid%
#   - %random-amount%
#   - %local-random% (only inside Random-Command entries that define local Random)
#   - %current-usage%
#   - %max-usage%
#
# Message-Chat:
#   Optional chat message sent to the player when the voucher is used.
#
# Message-Title:
#   Optional title message sent to the player when the voucher is used.
#   Title is required.
#   SubTitle is optional.
#
# Message-ActionBar:
#   Optional action bar message sent to the player when the voucher is used.
#
# Random-Command:
#   Weighted random command system.
#   Each sub-entry can have:
#   - Chance: required
#   - Command: required
#   - Message-Chat: optional
#   - Message-Title: optional
#   - Message-ActionBar: optional
#   - Random: optional local random number for that one reward only
#
#   Example:
#   Random-Command:
#     Reward1:
#       Chance: 20
#       Command: "eco give %player% %local-random%"
#       Message-Chat: "{prefix}&aYou won %local-random% coins!"
#       Message-Title:
#         Title: "&#1378FFReward"
#         SubTitle: "&fYou won %local-random% coins!"
#       Message-ActionBar: "&7Reward: &#1378FF%local-random%"
#       Random:
#         Min: 100
#         Max: 1000
#     Reward2:
#       Chance: 80
#       Command: "eco give %player% 500"
#
#   Notes:
#   - Higher Chance means higher probability.
#   - The total does not need to be 100.
#   - If Random-Command exists, it is used instead of Command.
#   - %local-random% only exists for the selected random reward entry.
#
# Random:
#   Optional random amount generator.
#   If present, %random-amount% will be replaced with a value between Min and Max.
#
# Attributes:
#   Optional item attributes.
#   Example format:
#   Attributes:
#     GENERIC_ARMOR:
#       Value: 20
#       EquipmentSlot: HAND
#
# Enchantments:
#   Optional enchantments.
#   Example format:
#   Enchantments:
#     DURABILITY: 3
#
# ItemFlags:
#   Optional item flags.
#   Example:
#   ItemFlags:
#     - HIDE_ATTRIBUTES
#     - HIDE_UNBREAKABLE
#
# Potion:
#   Optional potion effect that is applied to the player on use.
#   Example format:
#   Potion:
#     Type: "STRENGTH"
#     Level: 2
#     Duration: 90
#
# ============================================================
# Example vouchers
# ============================================================

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:
  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
  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:
  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:
  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:
  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