How to Make an Upgrade
An upgrade is something players buy for a placed minion, one tier at a time. Each upgrade is a set of effects, a ladder of tiers with their own costs, and the display shown in the upgrade menu. This page covers making one from scratch.
Quick start
Open the
/plugins/EcoMinions/upgrades/folder and copy_example.ymlto a new file, e.g.speed.yml. The file name is the upgrade ID.Set
nameanddisplay.icon.Add the
effectsthe upgrade gives, using%tier_value%for the number that changes per tier.Add each tier under
tiers, with itsvalue,stat-deltaandcost-options.Add the upgrade ID to a minion's
allowed-upgrades, run/minions reload, open that minion's upgrades menu, and confirm it appears.
Naming and IDs
The file name without .yml is the upgrade ID. This is what a minion's allowed-upgrades list and the minion_has_upgrade condition reference. display.icon uses the Item Lookup System, and cost-options use the Price Lookup System.
The structure of an upgrade
| Part | What it controls |
|---|---|
| Display | The upgrade's name and icon in the upgrade menu |
| Effects | What the upgrade does, shared by every tier |
| Tiers | Each tier's value, menu text, costs and buy conditions |
# === Display: how it shows in the upgrade menu ===
name: "&bSpeed" # The upgrade's name in the menu.
display:
icon: sugar # The upgrade's icon in the menu.
# === Effects: what the upgrade does ===
effects: # Effects shared by every tier. %tier_value% is the owned tier's value.
- id: minion_speed
args:
ticks_faster: "%tier_value%"
conditions: [] # Optional. Conditions that must pass for the effects to be active.
# === Tiers: the ladder players buy up ===
tiers:
1:
value: 5 # The number %tier_value% resolves to at this tier.
stat-delta: "-5 ticks" # Menu text describing this tier.
cost-options: # The ways a player can pay for this tier. They pick one.
- value: 5000
type: coins
display: "&a$%value_commas%"
- value: 64
type: stone
display: "&7%value_commas%x Stone"
buy-conditions: [] # Optional. Conditions that must pass to buy this tier.
2:
value: 10
stat-delta: "-10 ticks"
cost-options:
- value: 12000
type: coins
display: "&a$%value_commas%"
Display
How the upgrade shows in the minion's upgrade menu.
name: "&bSpeed" # The upgrade's name in the menu.
display:
icon: sugar # The upgrade's icon in the menu.
Effects
The effects the upgrade gives. They are written once and shared by every tier, and only the owned tier is ever active. Buying the next tier swaps the old tier out for the new one.
effects: # Effects shared by every tier. %tier_value% is the owned tier's value.
- id: minion_speed
args:
ticks_faster: "%tier_value%"
conditions: [] # Optional. Conditions that must pass for the effects to be active.
Two placeholders work inside the effects:
| Placeholder | Value |
|---|---|
%tier_value% | The value of the tier the minion owns. |
%tier% | The tier number the minion owns. |
Permanent effects such as minion_speed need no triggers: they are active while the tier is owned. Triggered effects, which is almost every stock libreforge effect, need a triggers list:
effects:
- id: multiply_drops
triggers:
- minion_mine_block # Runs each time the minion breaks a block.
args:
multiplier: "1 + %tier_value%"
For something that should run on a timer, use minion_static_<ticks> rather than minion_tick with every, as it only runs on the ticks it is due. The shipped auto sell upgrade sells every 200 ticks:
effects:
- id: minion_sell_storage
triggers:
- minion_static_200 # Runs every 200 ticks.
Tiers
The ladder players buy up, in order. Tier keys must be whole numbers.
tiers:
1:
value: 5 # The number %tier_value% resolves to at this tier.
stat-delta: "-5 ticks" # Menu text describing this tier.
cost-options: # The ways a player can pay for this tier. They pick one.
- value: 5000
type: coins
display: "&a$%value_commas%"
- value: 64
type: stone
display: "&7%value_commas%x Stone"
buy-conditions: [] # Optional. Conditions that must pass to buy this tier.
value has no meaning of its own. It is what %tier_value% resolves to, so it is a tick count, a multiplier or a flag depending on how the effects use it.
Each entry in cost-options is a price, so type can be coins, an item, or any other price type. When there is more than one, the player picks which to pay with. display is required on every entry, and %value% and %value_commas% work inside it.
buy-conditions are checked before the price. Use them to lock a tier behind a minion level, another upgrade, or anything else a condition can check.
Internal placeholders
These work in the upgrade menus in lang.yml.
| Placeholder | Value |
|---|---|
%upgrade_name% | The upgrade's name. |
%tier% | The tier the minion owns. |
%max_tier% | The highest tier. |
%delta% | The stat-delta of the tier being shown. |
%value% | A cost option's amount. |
%value_commas% | A cost option's amount, with commas. |
Where to go next
Minions: expose the upgrade with
allowed-upgradesin Configuring a Minion.Compacting: compactor recipes make their own upgrades, see How to Make a Compactor Recipe.
Levelling: lock tiers behind minion levels with How to Level a Minion.
Defaults: the shipped upgrades live here.