Configuring a Block

A block definition describes what a block is; the minion's type decides what is done with it. Each definition is one config file in blocks/. This page builds one from scratch.

Quick start

  1. Open the /plugins/EcoMinions/blocks/ folder and copy _example.yml to a new file, e.g. ebony.yml. The file name is the definition ID.

  2. Set block to the block it describes.

  3. Add the keys that block needs, e.g. plant and leaves for a custom tree.

  4. Run /minions reload and confirm no violation is reported for the file.

  5. Point a minion's target-blocks at the block and confirm it works it.

Naming and IDs

The file name without .yml is the definition ID, so blocks/oak.yml has the ID oak. The block key is what matches it to a target: target-blocks names OAK_LOG, not oak.

The structure of a block

PartWhat it controls
BlockWhich block the definition describes
GrowingWhat is planted to bring it back, and the tree it grows
MiningWhether minions can target it, and how it is cut
RewardsIts drops and XP
OverrideForcing a behaviour for this one block
# === Block: what this describes ===
block: OAK_LOG # The block this describes. Any block id, custom blocks included. Required.

# === Growing: bringing it back ===
plant: OAK_SAPLING # What is planted to bring it back: a sapling or a crop.
leaves: OAK_LEAVES # The canopy of the grown tree. Needed by woodcutters.
surface: GRASS_BLOCK # Optional. What must be underneath to plant here.
tree-pattern: oak # Optional. Which built-in tree shape to grow.

# === Mining: how minions treat it ===
mineable: true # Optional. Set false so no minion can target it. Defaults to true.
stacked-column: false # Optional. Whether it grows upward in a column, like sugar cane. Defaults to false.
promotes-to: "" # Optional. The block a minion really works when it targets this one, e.g. BAMBOO_SAPLING promotes to BAMBOO.

# === Rewards: drops and XP ===
drops: [] # Optional. The items one break gives, for custom blocks.
xp: 2-5 # Optional. The XP one break is worth, as a number or a range.

# === Override: forcing a behaviour ===
restore: tree # Optional. One of regen, replant or tree, beating the minion's type.

Block

A block definition describes what a block is. The minion's type decides what is done with it, which is why the same OAK_LOG is felled by a woodcutter and regenerated by a miner with no extra config.

block: OAK_LOG # The block this describes. Any block id, custom blocks included. Required.

Growing

What is planted to bring the block back, and the tree it grows.

plant: OAK_SAPLING # What is planted to bring it back: a sapling or a crop.
leaves: OAK_LEAVES # The canopy of the grown tree. Needed by woodcutters.
surface: GRASS_BLOCK # Optional. What must be underneath to plant here.
tree-pattern: oak # Optional. Which built-in tree shape to grow.

surface also turns on lift-regen for minions targeting this block, which is how a crop gets its farmland back with no extra config. tree-pattern defaults to the definition's ID, see Tree shapes.

Mining

Whether minions can target the block, and how they cut it.

mineable: true # Optional. Set false so no minion can target it. Defaults to true.
stacked-column: false # Optional. Whether it grows upward in a column, like sugar cane. Defaults to false.
promotes-to: "" # Optional. The block a minion really works when it targets this one, e.g. BAMBOO_SAPLING promotes to BAMBOO.

Set mineable: false for blocks that break badly, such as amethyst buds, dripstone or vines. A minion targeting one is reported at startup. A stacked-column block is only ever cut at its base, taking the whole column in one action.

Rewards

What one break gives the minion.

drops: # Optional. The items one break gives, for custom blocks.
  - "itemsadder:ruby"
xp: 2-5 # Optional. The XP one break is worth, as a number or a range.

Live mining already uses the drops of vanilla and EcoItems blocks. Set drops for other plugins' custom blocks, or to override them. Offline catch-up always needs drops for a custom block, as its drops cannot be rolled while nobody is online, so without it the block gives nothing offline. Vanilla ores already have their vanilla XP. Where XP goes is set by minion.xp.mode in Plugin Config.

Override

Forces one behaviour for this block, whatever the minion's type is. Almost never needed.

restore: tree # Optional. One of regen, replant or tree, beating the minion's type.

regen puts the block back exactly as it was, replant plants it again as a young plant, and tree fells it and plants a sapling. regen suits blocks that are already in place: on a crop it stops a farmer from planting anything. An override the definition cannot do, such as tree with no leaves, is reported and ignored.


Where to go next