How to Make a Compactor Recipe

A compactor recipe turns items in a minion's storage into a more compact form, such as nine coal into a coal block. Each recipe sets its input and output, its price, and optional conditions, and each minion type picks which recipes it can buy. This page covers making one from scratch.

Quick start

  1. Open the /plugins/EcoMinions/compactor-recipes/ folder and copy _example.yml to a new file, e.g. coal_block.yml. The file name is the recipe ID.

  2. Set name, display.icon, input, output and their amounts.

  3. Set cost-options.

  4. In a minion's config, add the recipe ID to compactor-recipes and add a minion_compact effect (see Letting a minion compact).

  5. Run /minions reload, buy the recipe from that minion's upgrades menu, and confirm its storage compacts.

Naming and IDs

The file name without .yml is the recipe ID. This is what a minion's compactor-recipes list references. Each recipe is bought as its own upgrade, with the ID compactor_<recipe id>, so coal_block becomes compactor_coal_block for the minion_has_upgrade condition. input, output and display.icon use the Item Lookup System.

The structure of a compactor recipe

PartWhat it controls
DisplayThe recipe's name and icon in the upgrade menu
RecipeWhat is used up and what is made
PriceWhat the recipe costs to buy
ConditionsWho can buy it and when it runs
# === Display: how it shows in the upgrade menu ===
name: "&8Coal Compactor" # The recipe's name in the menu.
display:
  icon: coal_block # The recipe's icon in the menu.

# === Recipe: what is used up and what is made ===
input: COAL # The item used up.
input-amount: 9 # How many are used up each time.
output: COAL_BLOCK # The item made.
output-amount: 1 # How many are made each time.

# === Price: what the recipe costs ===
cost-options: # The ways a player can pay for the recipe. They pick one.
  - value: 15000
    type: coins
    display: "&a$%value_commas%"

# === Conditions: who can buy it and when it runs ===
buy-conditions: [] # Optional. Conditions that must pass to buy the recipe.
conditions: [] # Optional. Conditions that must pass each time it compacts.
higher-level-of: "" # Optional. The recipe whose output this one uses up, so it runs after it.

Display

How the recipe shows in the minion's upgrade menu, the same as an upgrade.

name: "&8Coal Compactor" # The recipe's name in the menu.
display:
  icon: coal_block # The recipe's icon in the menu.

Recipe

What the recipe uses up and makes. It runs again and again while the storage holds at least input-amount of input.

input: COAL # The item used up.
input-amount: 9 # How many are used up each time.
output: COAL_BLOCK # The item made.
output-amount: 1 # How many are made each time.

Price

What the recipe costs. It is bought once, with no tiers, and uses the same cost-options as an upgrade tier. See How to Make an Upgrade.

cost-options: # The ways a player can pay for the recipe. They pick one.
  - value: 15000
    type: coins
    display: "&a$%value_commas%"

Conditions

Two separate, optional gates, plus an ordering hint for chained recipes.

buy-conditions: # Optional. Conditions that must pass to buy the recipe.
  - id: minion_has_upgrade
    args:
      upgrade: compactor_coal_block
conditions: # Optional. Conditions that must pass each time it compacts.
  - id: minion_level_above
    args:
      level: 5
higher-level-of: coal_block # Optional. The recipe whose output this one uses up, so it runs after it.

buy-conditions are checked once, when a player tries to buy the recipe. conditions are checked every time the minion compacts, so an owned recipe does nothing while they fail.

higher-level-of only sets the order. A recipe that uses up coal blocks with higher-level-of: coal_block runs after coal_block, so coal becomes coal blocks first. It does not lock the purchase: use a minion_has_upgrade buy condition for that, as above.

Letting a minion compact

A recipe does nothing until a minion type lists it and has a minion_compact effect to run it. Both go in the minion's own config:

compactor-recipes: # The recipes this minion can buy, in menu order.
  - coal_block
effects: # The effect that runs the minion's owned recipes.
  - id: minion_compact
    triggers:
      - minion_mine_block

Listing a recipe also allows its upgrade, so it does not need to be in allowed-upgrades too. Without the minion_compact effect, owned recipes never run.


Where to go next