WandWorks

Builder wands

How the line is worked out, where the blocks come from in each mode, and every key that changes the result.

A builder wand extends the block you clicked, in the direction of the face you clicked, up to the line length set on the wand. There are two modes and they differ in one thing only: where the blocks come from.

TypeWhere the blocks come from
build-inventoryThe player's own inventory
build-shopBought from your shop at the buy price

Both can also draw from an InfiniteBags bag, see Bag mode.

This is not a WorldEdit add-on. The line logic is inside the plugin and WorldEdit is never involved.

How the line is worked out

Check the clicked block

The material you clicked has to pass the wand's whitelist and blacklist. If it does not, nothing happens and the player is told.

Walk out from the clicked face

The wand steps out one block at a time, up to length steps, in the direction of the face that was clicked. Click the top of a block and the line goes up.

Keep only the positions it may fill

A position is kept when it is inside the world's build limits and the block already there is on the replaceable list in config.yml.

Place, one block at a time

Each block copies the clicked block's own block data, so stairs, logs and slabs come out facing the same way. Every single placement fires a normal BlockPlaceEvent.

An obstruction is skipped, not treated as the end of the line. If the third position along is solid stone, the wand places positions one, two, four and five and steps over the third. Same for a position a protection plugin refuses.

The default replaceable list is deliberately small:

replaceable:
  - AIR
  - CAVE_AIR
  - SHORT_GRASS
  - TALL_GRASS
  - SNOW

Anything not on that list is never overwritten. Add to it if you want the wand replacing water or leaves.

Protection plugins still win

Every block fires a real BlockPlaceEvent before it counts. WorldGuard, Lands, GriefPrevention, Towny and the rest see it and can cancel it. A cancelled block is put straight back and skipped, and the rest of the line still goes down. The player is charged for nothing they did not get.

Where the blocks come from

Four rows showing the source order for inventory mode with bag use off, inventory mode with either source-order setting, and shop mode where the bag always goes first

The blocks come out of the player's inventory, and the wand places as many as they actually have. Run out halfway and the line stops there, with a message saying that is all they had.

With bag use on, the bag joins in as a second source. Which one is tried first is set by building.source-order in config.yml:

building:
  # inventory or bag
  source-order: inventory

The off hand and armour slots are not counted or touched.

Uses

The same five block click costing one use under per-click and five uses under per-block

uses-mode decides what one click costs.

ValueOne click costs
per-clickuses-per-action, whatever the line turns out to be
per-blockOne use for every block that actually goes down

In per-block mode the line is also cut short by what is left. A wand with three uses left places three blocks, not five, and does not go into debt.

Nothing is charged for a click that places nothing.

Keys on a builder wand

KeyWhat it doesDefault
typebuild-inventory or build-shopnone
lengthHow many blocks one click reaches for5
usesUses a fresh wand starts with0
uses-modeper-click or per-blockper-click
uses-per-actionUses one click costs in per-click mode1
on-emptybreak or keep at zero usesbreak
bag-defaultBag use state a fresh wand starts onfalse
cooldownSeconds between uses, per player0
whitelistOnly these materials can be extended. Empty means everythingempty
blacklistThese materials can never be extendedempty
soundPlayed on a successful clicknone

boost, minimum-value, maximum-value, show-item-count and show-boost do nothing on a builder wand. They are sell keys.

Example

wands:
  builder:
    type: build-inventory
    item:
      material: BREEZE_ROD
      name: "&bBuilding Staff"
      custom-model-data: 1002
      glow: true
      durability-bar: false
      flags:
        - HIDE_ATTRIBUTES
        - HIDE_ENCHANTS
      lore:
        - "&7Right-click a block to extend it."
        - "&7Sneak and right-click to switch bag use."
        - ""
        - "&fBlocks per click: &b{length}"
        - "&fBag use: &b{bag}"
        - "&fUses left: &b{uses}"
    uses: 250
    uses-mode: per-click
    on-empty: break
    length: 5
    bag-default: false
    permission: wandworks.use.builder
    cooldown: 0
    sound: BLOCK_STONE_PLACE
    whitelist: []
    blacklist:
      - BEDROCK

Turning that into a shop mode wand is a one word change to type: build-shop. The example file ships with both.

When it refuses

What the player seesWhy
This wand is not allowed to place that blockThe clicked material failed the whitelist or blacklist
There was no room to place anythingEvery position along the line was solid or outside the build limits
You do not have any of that blockInventory mode, and the player has none, and the bag has none either
X has no buy price, so it was skippedShop mode, and no price source has a buy price for that block
You cannot afford even one blockShop mode, and the balance will not cover one
This wand is off because no economy plugin was foundShop mode with no Vault economy installed
Placed N blocks, that is all you hadThe line ran longer than the player's stock
Placed N blocks for X, that is all you could affordThe line ran longer than the player's balance

On this page