Minion type files
Every section and key of a minion type file in the minions folder, and how to make a new minion type.
Each minion type lives in its own file in the minions folder. One file sets what the minion does, what its item and body look like, how it grows with each level and who else may use it. Copy a file and you have a new type, with no code involved.
The plugin ships nine: farmer.yml, miner.yml, lumberjack.yml, hunter.yml, fisherman.yml, chunkloader.yml, chunkcollector.yml, feeder.yml and seller.yml. The file name, without .yml, is the type id you use in commands, permissions, the shop and upgrades.
Top of the file
| Key | Farmer default | What it does |
|---|---|---|
minion-version | 5 | The file's version key. Leave it alone, see Configuration. In 1.1.0 feeder.yml and seller.yml are at 3 and the other shipped types at 4 |
enabled | true | false stops the type from loading at all |
behaviour | FARMER | The built in job this type runs. One of FARMER, MINER, LUMBERJACK, HUNTER, FISHERMAN, CHUNK_LOADER, CHUNK_COLLECTOR, FEEDER or SELLER |
display-name | <yellow>Farmer Minion | The name shown in menus, holograms and messages |
description | one line | A list of lines added under the lore of the info button in the minion menu. The minion menu placeholders, such as %level%, work in them. An empty list adds nothing |
A type with no behaviour, an unknown behaviour, or no usable levels is skipped with a warning in the console. So is a file whose name only differs in upper and lower case from a shipped file, such as Farmer.yml.
If you switch a type off while minions of that type are placed, those minions keep their old settings until the next restart. After a restart they are left out, with a warning in the console for each one.
Changing a file while minions are placed
Edit the file and run /minion reload. Placed minions of that type take the new values straight away: levels, caps, settings, trusted actions, the hologram and the look. A minion whose look changed is put back with the new one.
A few changes cannot be applied to minions that are already placed. The reload names them in a short summary, both to you and in the console:
- Changing
behaviourneeds a restart. Until then those minions keep the whole old type. - Removing levels leaves minions above the new highest level. They keep their level and work with the highest level's values.
- Lowering the storage below what a minion holds keeps every item. The minion stops collecting until it is emptied below the new size.
- Taking an upgrade out of
allowed-upgradesleaves the ones already installed working. New ones are refused.
See Admin tools for every line of the summary.
Limits and caps
These are ceilings. Levels and upgrades can raise a minion's stats, but never past these values.
| Key | Farmer default | What it does |
|---|---|---|
max-per-player | 5 | How many of this type one player may place, separate from the total limit. Reaching it sends placement.type-limit-reached. A minioncore.limit.<type>.<number> permission replaces it, see Limits by rank |
requires-fuel | true | Whether this type uses fuel. With false the fuel slot and fuel efficiency button leave the menu |
max-stored-actions | 5000 | The most fuel actions the minion can hold. 0 means no limit |
min-delay | 2 | The shortest delay between actions this type can ever reach, in seconds. Never lower than 1. The shipped fisherman uses 2 as well |
max-range | 5 | The largest range this type can ever reach, in blocks. 0 hides the range button |
max-storage | 90 | The largest storage this type can ever reach, in slots. 0 means no storage, and hides the storage, storage upgrade and filter buttons. The shipped files use 90 for every type with storage, so storage upgrades can push past the top level's 36 slots |
max-connections | not set | Chunk collectors only. The most minions one collector can ever be paired with, upgrades included. The shipped collector uses 6. See Collector pairing |
height | 1 | How many blocks up and down from the minion the work area reaches |
fuel
How this type uses fuel, on top of requires-fuel and max-stored-actions. Every shipped type file has this section.
fuel:
per-action: 1.0
accepted: all
items: {}| Key | Farmer default | What it does |
|---|---|---|
per-action | 1.0 | How much stored fuel each action uses before upgrades and fuel efficiency are counted. It multiplies the whole fuel use, so %fuel_use% and the Fuel button include it. A chunk loader uses fuel by time, not by action |
accepted | all | all, or a list of fuel ids from fuel.yml this type takes. A fuel's own types list still has to allow this type too |
items | {} | Fuels only this type takes. Each entry is written like a fuel.yml entry without types. Its id is <type>:<key>, such as miner:coal, which works with /minion fuel and in shop entries. These are checked before the fuels in fuel.yml |
Left out, a type uses per-action: 1.0 and takes every fuel, as before 1.1.0. Examples for plain coal and a fuel for one type are on Fuel.
breakdowns
The repair price of this type. Every shipped type file has this section except chunkloader.yml, since chunk loaders never break down.
breakdowns:
repair-cost: DEFAULT
repair-cost-per-upgrade: DEFAULT
repair-items: DEFAULT| Key | Farmer default | What it does |
|---|---|---|
repair-cost | DEFAULT | DEFAULT uses breakdowns.repair-cost in config.yml. A section of currency ids with amounts replaces it for this type |
repair-cost-per-upgrade | DEFAULT | DEFAULT uses breakdowns.repair-cost-per-upgrade in config.yml. A section replaces it for this type |
repair-items | DEFAULT | DEFAULT uses breakdowns.repair-items in config.yml. A section of item entries, written like the ones in config.yml, replaces them for this type |
An empty section, {}, means nothing for that part, so repair-items: {} takes no items from players repairing this type. The breakdown chance always comes from config.yml. See Breakdowns and repairs.
item
The item a player holds, places and gets back on pickup. It is never placed as a block, even as a head.
| Key | Farmer default | What it does |
|---|---|---|
material | PLAYER_HEAD | The item material |
head | a base64 texture | The head texture shown when the material is PLAYER_HEAD. Each shipped type has its own |
name | <yellow>Farmer Minion | The item name |
lore | four lines | The lines under the name. The shipped files show the level and %upgrades% |
custom-model-data | 0 | Custom model data for a resource pack. 0 leaves it off |
itemsadder | "" | An ItemsAdder item id to use instead of the material. Empty ignores it |
glow-from-level | 0 | The level from which the item glows. 0 means it never glows. The shipped feeder and seller use 3 |
The lore can show the minion's current values, which are filled in whenever the item is made:
| Placeholder | Shows |
|---|---|
%level% | The minion's level |
%fuel% | Stored fuel actions |
%upgrades% | Upgrades applied, all kinds together |
%storage_upgrades% | Storage upgrades applied |
%speed_upgrades% | Speed upgrades applied |
%range_upgrades% | Range upgrades applied |
%fuel_upgrades% | Fuel efficiency upgrades applied |
%seller_sold% | Items sold, for a seller |
%feeder_given% | Fuel actions handed out, for a feeder |
Item keys
Every item section in the plugin (type items, fuel items, upgrade items, menu buttons, shop icons) is read the same way, so all of these keys work anywhere an item or button is set, even when the shipped file does not list them.
| Key | What it does |
|---|---|
material | The item material. An unknown material skips the item with a warning |
amount | Stack size, 1 when left out. Minion items are always a single item |
name | The item name, in MiniMessage |
lore | A list of lines under the name |
custom-model-data | A whole number for a resource pack model. 0 leaves it off |
item-model | An item model key such as mypack:ruby. A server too old for item models skips it with a warning |
flags | A list of item flags, such as HIDE_ENCHANTS |
enchantments | Enchantment names, each with a level, such as sharpness: 2 |
head | A player name, or a base64 texture, for a PLAYER_HEAD |
glow | true adds an enchanted shine without showing an enchantment |
itemsadder | An ItemsAdder item id used instead of the material. If ItemsAdder or the item is missing, the material is used |
mythicmobs | A MythicMobs item id used instead of the material, and before itemsadder when both are set. If MythicMobs or the item is missing, itemsadder is tried, then the material |
saved-item | A whole item stored in the server's own item format. When present, every other key is ignored. MinionCore has no command that writes one for you |
appearance
How the placed minion looks in the world.
| Key | Farmer default | What it does |
|---|---|---|
type | VANILLA | One of VANILLA, CUSTOM_MODEL_DATA, ITEMSADDER, MODELENGINE or PROVIDER. An unknown value falls back to VANILLA |
provider | not set | With PROVIDER, the id of a look another plugin registered through the API |
use-mannequin | true | With VANILLA, or when an ITEMSADDER or MODELENGINE look falls back to it, uses a Mannequin with a real player model on Spigot and Paper servers from 1.21.9. Older servers use a small armour stand |
use-owner-skin-when-no-model | DEFAULT | With VANILLA, whether the minion wears its owner's skin instead of head. DEFAULT follows appearance.use-owner-skin-when-no-model in config.yml, true or false overrides it. See Minion types |
custom-model-data | 0 | With CUSTOM_MODEL_DATA, the model data put on the worn or held item. 0 means none |
item-model | "" | With CUSTOM_MODEL_DATA, an item model key put on the same item, on servers that support it |
custom-model-slot | HEAD | Where the custom item goes, HEAD or HAND. Used by CUSTOM_MODEL_DATA and ITEMSADDER |
head | a base64 texture | A player name, or a base64 texture, for the head. The shipped files use the same texture as item.head |
armour-colour | 200,180,60 | Leather armour colour, written as red,green,blue from 0 to 255. Empty means no armour |
hand | IRON_HOE | The material held in the main hand. With CUSTOM_MODEL_DATA this is also the material of the custom item, PAPER when empty |
animation | true | Whether the minion plays its action animation, set in motion below. With MODELENGINE the work animation also plays |
itemsadder | "" | With ITEMSADDER, the ItemsAdder item worn or held |
modelengine.model | "" | With MODELENGINE, the ModelEngine model id |
modelengine.idle-animation | idle | The animation played while idle |
modelengine.work-animation | work | The animation played on every action. A list, such as [swing_a, swing_b], plays one of them at random |
modelengine.action-animations | {} | Animations used instead of work-animation for one kind of action, see ModelEngine animations |
modelengine.status-animations | {} | Animations played while the minion has a status |
modelengine.event-animations | {} | Animations played once on place, pickup, fuel, upgrade, repair or break |
modelengine.level-models | {} | Models used from a level upward instead of model, keyed by level |
modelengine.speed | 1.0 | The speed work, status and event animations play at |
modelengine.speed-delay | 0 | Above 0, the work animation speed follows the minion's delay, with this many seconds as the delay the animation was made for |
modelengine.lerp-in | 0.1 | Seconds an animation takes to blend in |
modelengine.lerp-out | 0.1 | Seconds an animation takes to blend out |
modelengine.impact-delay | 0 | Ticks between the start of the work animation and the action itself |
modelengine.pickup-delay | 0 | Ticks the model stays after pickup so the pickup animation can play |
motion.style | SWING | The strike played on each action: SWING, CHOP, DIG, SLASH, CAST, SWEEP, OFFER or NONE. An unknown value logs a warning that names the file and uses SWING |
motion.swings | 1 | How many strikes play on each action |
motion.turn-to-target | true | Whether the minion turns to face the block or mob it works on |
motion.step-distance | 0.3 | How far in blocks the minion steps toward what it works on. 0 keeps it in place |
motion.turn-ticks | 3 | How many ticks turning takes |
motion.step-ticks | 4 | How many ticks a step out or back takes |
A motion key left out of a file uses the default for that type's behaviour, so a custom type file with no motion section still animates. See Work animation for what each style looks like.
If ItemsAdder, ModelEngine, the named model or the named provider is missing, the minion uses the VANILLA look, Mannequin included when use-mannequin is on, and the console says why once.
ModelEngine animations
Every key below is optional. A file without them behaves as before: the idle animation plays from the start and the work animation plays on each action.
appearance:
type: MODELENGINE
modelengine:
model: farmer
idle-animation: idle
work-animation: [work_a, work_b]
action-animations:
harvest: harvest
plant: plant
status-animations:
NO_FUEL: sleep
STORAGE_FULL: sit
BROKEN: broken
event-animations:
place: spawn
upgrade: celebrate
pickup: wave
level-models:
5: farmer_iron
10: farmer_gold
speed: 1.0
speed-delay: 10
impact-delay: 8
pickup-delay: 20- Status animations play while the minion has that status and stop when it changes. The statuses are
WORKING,NO_FUEL,STORAGE_FULL,NO_TARGET,PAUSED,CHUNK_UNLOADED,OWNER_OFFLINEandBROKEN. A status with no entry playsidle-animation. With no entries at all the idle animation simply keeps playing. - Action animations are keyed by the kind of action:
minefor miners,harvest,plantandtillfor farmers,chop,plantandgatherfor lumberjacks,attackfor hunters andfishfor fishermen. A kind with no entry useswork-animation. - Event animations play once over whatever is running. A
pickupanimation only shows whenpickup-delayis above0, since the model is otherwise removed at once. During that time the model is not the minion any more, it cannot be clicked and it is not saved with the world. - Level models pick the entry with the highest level at or below the minion's level. Levelling up, or
/minion admin setlevel, swaps the model straight away. - Speed delay scales the work animation to the minion. With
speed-delay: 10a minion with a 5 second delay plays it twice as fast, and one with a 20 second delay at half speed. - Impact delay waits that many ticks after the work animation starts before the action happens, so a swing lands on the block. Before acting, the minion checks the blocks are still the same and the mobs are still alive. If anything changed, it looks for a new target instead.
Random and out of step animations
Placed minions of one type used to play idle in perfect step. Two keys and a new way of writing animations fix that:
appearance:
modelengine:
idle-animation:
idle: 5
idle_stretch: 1
status-animations:
NO_TARGET: [search, yawn, look_around]
idle-variant-seconds: 15
random-start-delay: 40- Any animation can be one name, a list of names picked at random, or a section of
name: weight, where a higher weight is picked more often. Above,idleplays five times as often asidle_stretch. This works foridle-animation,work-animationand every entry understatus-animations,action-animationsandevent-animations. idle-variant-secondsabove0picks a new variant of the idle or status animation every that many seconds, give or take a quarter, so a minion does not loop the same idle forever. Each minion has its own timing.random-start-delayabove0makes each minion wait a random number of ticks, up to this value, before it starts its idle or status animation. That happens when it spawns and on every status change, so minions placed together, or loaded together after a restart, do not move in unison.- Both ship at
0, which keeps the old behaviour.
After changing a model
When you edit a model's animations and run meg reload, MinionCore puts the model back on every loaded ModelEngine minion as soon as ModelEngine finishes, so the change shows without renaming the model. Turn that off with modelengine.refresh-on-reload: false in config.yml. /minion reload and /minion admin refresh-models do the same by hand. Neither touches the minion's data, they only swap the model on the entity.
levels
One numbered block per level, starting at 1. The highest number is the top level. Farmer ships with four:
levels:
1:
range: 1
delay: 10
storage: 9
fuel-efficiency: 0
cost:
money: 10000
2:
range: 2
delay: 8
storage: 18
fuel-efficiency: 5
cost:
money: 25000| Key | What it does |
|---|---|
range | Blocks from the minion to the edge of its work area. 1 is a 3x3 area, 2 is 5x5 |
delay | Seconds between actions. Never lower than 1 |
storage | Storage slots |
fuel-efficiency | How much less fuel each action uses, in percent, from 0 to 100. See Fuel |
connections | Chunk collectors only. How many minions the collector can be paired with at this level. Left out, a collector uses its level number, so level 3 allows 3. Shipped as 1 to 4 |
chunk-radius | Chunk loaders and chunk collectors only. 1 is just the chunk the minion stands in, 2 is 3x3 chunks, 3 is 5x5 chunks |
cost | What it costs to buy the next level, as currency ids from upgrades.yml with an amount each |
description | Lines shown on the Level button while this is the next level. Shipped empty from level 2 up |
requirements | Permissions and PlaceholderAPI conditions a player must meet to buy this level. See Level requirements |
A key left out of a level copies the value from the level before it, except connections. Level 1 falls back to range 1, delay 10, storage 9, fuel efficiency 0 and chunk radius 1.
The top level needs no cost, since there is nothing left to buy. Any other level without a cost makes the next level free, and the console prints a warning naming that level when the file loads. A cost can mix several currencies:
cost:
money: 25000
tokens: 50How mixed costs are checked, taken and refunded is on Fuel and upgrades. Upgrades add on top of the level values, still capped by the limits above. See Levels and upgrades.
allowed-upgrades
| Value | What it does |
|---|---|
all | Accepts every upgrade in upgrades.yml |
| a list of ids | Accepts only those upgrade ids |
allowed-upgrades:
- storage-1
- speedAn upgrade must also allow the type in its own types list. Some kinds only fit one behaviour whatever the lists say: speed upgrades never apply to chunk loaders, fire aspect, damage and looting only to hunters, silk touch only to miners and farmers, connections only to chunk collectors and replant only to lumberjacks. See Levels and upgrades.
settings
The part that is different for every behaviour: which crops a farmer harvests, what a miner breaks, what a hunter targets, the fisherman's loot, how often a chunk loader uses fuel. Each behaviour page lists its own keys.
Keys added in 1.0.0-2:
| Key | Types | What it does |
|---|---|---|
block-list.mode, block-list.blocks | miner, farmer, lumberjack | An extra OFF, BLACKLIST or WHITELIST list of blocks, checked before the normal list |
crops.CACTUS, crops.BAMBOO | farmer | Whether cactus and bamboo are cut down to their bottom block |
replant | lumberjack | UPGRADE, ALWAYS or OFF, replacing replant-sapling |
sapling-slots, plant-clearance, sapling-spacing | lumberjack | The sapling store size and where new saplings may be planted |
mode, modes | chunk collector | What a new collector collects (PAIRED shipped), and which modes the owner can switch between |
filter
The filter a newly placed minion starts with. Players can change it in the menu afterwards.
| Key | Farmer default | What it does |
|---|---|---|
enabled | true | Whether this type may use a filter. A type file with no filter section cannot use one |
mode | ACCEPT | ACCEPT keeps only the listed items. IGNORE throws the listed items away |
entries | [] | Starting entries: material names, itemsadder:namespace:id items, or group names from filters.yml. An empty list keeps everything |
Filters can also be switched off for every type at once in filters.yml. See Filters.
trusted
What a player the owner has trusted may do with this type. The owner can always do everything.
| Key | Default | Lets a trusted player |
|---|---|---|
open | true | Open the menu |
take-storage | true | Take items out of the storage |
fuel | true | Add fuel |
upgrade | true | Apply upgrades and buy levels |
filter | true | Change the filter |
pickup | false | Pick the minion up |
repair | true | Repair the minion after it breaks down |
saplings | true | Lumberjack only. Add and take saplings in the sapling store |
pair | false | Chunk collector only. Pair minions with the collector and unpair them |
block-filter | false | Miner, farmer and lumberjack only. Change the block filter |
A key left out counts as allowed, except pickup, pair and block-filter. If the section is missing, every action except those three is allowed. Pausing and managing the trust list stay with the owner. See Trust and access.
block-filter
Miner, farmer and lumberjack types only. Lets players choose per minion which blocks it breaks.
| Key | Farmer default | What it does |
|---|---|---|
enabled | true | Whether the Block filter button shows and the filter is used. Left out, it counts as true |
max-entries | 27 | The most blocks one minion's list can hold |
See Block filter.
hologram
| Key | Farmer default | What it does |
|---|---|---|
enabled | true | Whether this type shows a hologram. holograms.enabled in config.yml switches them all off |
offset-y | DEFAULT | How far above the minion's block the hologram starts. DEFAULT uses holograms.y-offset in config.yml |
line-spacing | 0 | 0 keeps every line in one hologram. Above 0, each line is its own hologram, this many blocks apart |
lines | four lines | The hologram text, top to bottom. The shipped files show the type, level, a Storage %stored%/%capacity% line and the status. The chunk loader has no storage line |
states | BROKEN | Lines shown instead of lines while the minion has that status. An empty list hides the hologram for that status. The chunk loader ships with none |
level-offsets | {} | Extra height from a level upwards, such as 5: 0.5 |
appearance-offsets | 0 each | Extra height for ARMOUR_STAND, MANNEQUIN, MODELENGINE and ITEMSADDER, going by the look the minion really shows |
| Placeholder | Shows |
|---|---|
%type% | The type's display name |
%minion_name% | The type's display name, the same as %type% |
%owner% | The owner's name |
%level% | The level |
%status% | The status text from the language file, such as "Working" or "Out of fuel" |
%fuel% | Stored fuel actions |
%fuel_use% | Fuel used per action, with two decimals, such as 1.10 |
%used% | Storage slots in use |
%slots% | Storage slots in total |
%stored% | Items in storage, counted one by one |
%capacity% | How many items the storage holds, the slots times 64 |
%delay% | Seconds between actions |
How the heights add up, with a worked example for a tall model, is on Holograms and effects.
| Key | Default | What it does |
|---|---|---|
style | the vanilla look | The box behind the text, shadow, see through, text opacity, alignment, line width, billboard, scale and translation. See Style |
state-styles | {} | Style keys used instead while the minion has a status |
background-lines | [] | Lines drawn behind the text, such as a font glyph frame. See Background frame |
background-style | no box | The style of the frame, laid over style |
background-offset | "0,0,-0.01" | How far the frame sits from the text, as x,y,z |
area-preview
The type's own settings for the work area preview. enabled: false hides the Work Area button for this type. Every other key ships as DEFAULT, which uses the matching key in the area-preview section of config.yml, so one type can have a red outline while the rest keep the server wide one:
area-preview:
enabled: true
colour: "255,85,85"
duration: DEFAULTThe keys are the same as in config.yml.
sounds and particles
| Key | Default | What it does |
|---|---|---|
sounds.action | "" | Played on every action that has no entry under sounds.actions |
sounds.hearing-radius | 16 | How far away players hear this minion |
sounds.actions | {} | A sound per kind of action |
sounds.events | {} | Sounds used instead of the config.yml ones for this type, plus menu-open and interact |
sounds.status | {} | A sound when the minion gets a status, repeated every interval seconds when set |
sounds.ambient | no sound | A sound played now and then in the listed statuses |
particles.action | "" | A particle name such as CRIT, shown on every action |
How to write each sound, with examples, is on Per type sounds. Particles for placing, picking up, upgrades and fuel are set once for every type in config.yml.
Making a new minion type
Copy a file with the right behaviour
Copy the shipped file whose behaviour you want. For a second miner, copy minions/miner.yml to minions/deepslate_miner.yml. The new type id is deepslate_miner.
Change what makes it different
Set a new display-name, change item so players can tell the items apart, and adjust levels, appearance and settings.
Reload
Run /minion reload. New files in the minions folder are picked up without a restart.
Hand it out
Give one with /minion give <player> deepslate_miner, or add it to shop.yml so players can buy it. See Shop and claims.
Updates to your own type files
A file you made yourself has no copy inside the jar, so it is updated from the shipped file with the same behaviour. A CHUNK_COLLECTOR file such as ground-collector.yml is updated from chunkcollector.yml, a MINER file from miner.yml, and so on.
This happens on start and on /minion reload when the file's minion-version is lower than the shipped file's, or missing. Keys the file does not have are added with the shipped values, and every value already in the file stays as it is. These are never taken from the shipped file, so your type keeps its own identity:
levelsitemappearancedisplay-namebehaviourenabled
The console prints one line for each file it updates:
Updated minions/ground-collector.yml from version 1 to 3 using chunkcollector.yml.A file with no behaviour, or one the plugin does not know, is loaded as it is and never changed.
Up to 1.0.0-3 a file you made yourself was never updated, so it missed every key added since you copied it. Starting with 1.0.0-4 it catches up on the first start.