Commands API

Overview

The default example voucher file is useful because it shows several different item styles in one place: a temporary permission voucher, a random money voucher, a HeadDatabase head, a base64 texture head, and a weighted random reward item. Together they cover most of the common setup patterns.

What an item can define

  • Material, display name, lore, glow, unbreakable state, model data, texture, and item flags.
  • Usage count, enable state, click action, fixed command, or weighted random reward logic.
  • Chat, title, subtitle, and action bar feedback when the item is used.
  • Optional potion effects, enchantments, and attributes for more custom behavior.

Vanilla behavior note

  • Voucher items do not keep their normal vanilla behavior.
  • Blocks used as voucher materials cannot be placed.
  • Usable materials like ender pearls, fireworks, or food do not work as normal items.
  • The configured voucher action is the only thing that can trigger the reward.

Supported Click Actions

Base triggers

RIGHT CLICK, LEFT CLICK, and MIDDLE CLICK are supported as normal voucher triggers.

Extended triggers

SHIFT + RIGHT CLICK, SHIFT + LEFT CLICK, SHIFT + MIDDLE CLICK, HAND SWITCH, and SHIFT + HAND SWITCH are also valid.

Example Item Set

fly-permission

A glowing feather item that grants a temporary fly permission and can be used twice.

Material: FEATHER Usage: 2 Glow: true Action: SHIFT + RIGHT CLICK

money

A money voucher that rolls a random economy amount and inserts it into the reward command.

Material: BOOK Usage: 1 Random: 20000-50000

hdb-head-example

A minimal custom head item using a HeadDatabase id directly in the material field.

Material: HDB-13376 Usage: 1 HeadDatabase

texture-head-example

A player head item that uses a base64 texture value instead of an external head id.

Material: PLAYER_HEAD Usage: 1 Texture: base64

random-permission

An advanced anvil voucher with weighted reward entries, messages, and local random values.

Material: ANVIL Usage: 2 Random-Command Messages enabled