WandWorks

Defining wands

Every key in wands.yml, what the item block controls, and how to add your own wand variants.

wands.yml is where the wands themselves are defined. Each entry under wands: is one wand id, and you can have as many as you like.

wands:
  seller:      # <- the wand id
    type: sell
    ...
  builder:
    type: build-inventory
    ...

The id is what you type in /wandworks give, what shows in /wandworks list, and what the default permission is built from. Keep it lowercase and without spaces.

Adding a wand

Copy an existing block

Copy one of the three shipped entries, top to bottom, and paste it under wands:.

Change the id

The first line of the block. It has to be unique in the file.

Change the permission

Set permission to something matching the new id, and give it to the ranks that should have it.

Reload

/wandworks reload, then /wandworks list to check it loaded.

A wand entry with an unknown type, no item section, or a material that is not a real item is skipped with a console warning naming the id. The rest of the file still loads. If a wand goes missing, that warning says why.

The item block

A wand tooltip with each line labelled by the wands.yml key that produced it, next to the wand_id, uses and bag values stored on the item
item:
  material: BLAZE_ROD
  name: "&aSelling Staff"
  custom-model-data: 1001
  glow: true
  durability-bar: false
  flags:
    - HIDE_ATTRIBUTES
    - HIDE_ENCHANTS
  lore:
    - "&7Right-click a chest to sell what is inside."
    - ""
    - "&fBoost: &a{boost}x"
    - "&fUses left: &a{uses}"
KeyWhat it doesDefault
materialThe Bukkit material. Has to be something that exists as an itemrequired
nameDisplay name, colour codes allowedthe wand id
custom-model-dataFor resource pack models. Leave it out to set nothingnot set
glowEnchantment shimmer without an enchantmentfalse
durability-barDrives the vanilla durability bar from the uses leftfalse
flagsTooltip parts to hide. Bukkit ItemFlag namesempty
loreThe tooltip lines under the nameempty

durability-bar needs the wand to have uses above zero, since it needs something to measure against. An empty line in lore is a blank row in the tooltip, which is the usual way to break the block up.

Lore placeholders

PlaceholderPrints
{uses}Uses left on this particular wand
{boost}The wand's boost, trimmed. 1.25 rather than 1.2500
{length}The wand's line length
{bag}Whether bag use is on, in the player's language

On a server with no InfiniteBags, every lore line containing {bag} is dropped from the item rather than printed as "off".

Colours

Legacy ampersand codes plus &#RRGGBB for hex, which works everywhere colour does, name and lore alike.

name: "&#7c5cffWand&#a78bfaWorks"

Uses

uses: 250
uses-per-action: 1
uses-mode: per-click
on-empty: break
KeyWhat it doesDefault
usesUses a fresh wand starts with0
uses-per-actionUses one action costs1
uses-modeBuilder wands only. per-click or per-blockper-click
on-emptybreak removes the wand with a sound, keep leaves it there doing nothingbreak

A negative number in any of these is read as zero. length is the exception and is raised to 1.

uses-per-action: 0 on a wand with uses above zero gives you a wand that never runs down. The uses row in the lore just sits at its starting number.

Type specific keys

KeyWhat it doesDefault
boostMultiplies the priced total of a sale1.0
minimum-valueSales worth less than this are refused0.0
maximum-valuePayout cap. 0 turns the cap off0.0
show-item-countPuts the item count in the sale messagetrue
show-boostPuts the boost in the sale messagetrue

Full behaviour on Sell wand.

Keys from the other type are read and then ignored, so leaving them in a copied block does no harm. It is just noise.

Shared keys

permission: wandworks.use.seller
cooldown: 3
sound: ENTITY_EXPERIENCE_ORB_PICKUP
whitelist: []
blacklist:
  - BEDROCK
KeyWhat it doesDefault
permissionNode needed to use this wandwandworks.use.<id>
cooldownSeconds between uses, per player, per wand0
soundPlayed on a successful action. Leave it out for silencenone
whitelistOnly these materials. Empty means everythingempty
blacklistNever these materials. Beats the whitelistempty

What the lists apply to

The same two lists mean different things per type.

TypeThe lists filter
sellEach item inside the container
build-inventory, build-shopThe block that was clicked

An unknown material name in either list gets a console warning naming the wand and the entry, and is skipped.

Sounds

Both styles are accepted, so write whichever you have to hand:

sound: ENTITY_EXPERIENCE_ORB_PICKUP
# or
sound: entity.experience_orb.pickup

An unknown sound gets a console warning and the wand plays nothing.

The three shipped wands

Treat them as worked examples. Edit them, rename them, or delete them once you have your own.

What lives on the item

Three values are written into the wand item itself, not into a database:

ValueWhat it is
wand_idWhich entry in wands.yml this is
usesUses left on this particular wand
bagWhether bag use is on

Two wands of the same id can therefore hold different values, and giving a wand away gives its state away with it. An item that loses these is a normal item again and does nothing.

On this page