MinionCore logoMinionCore

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

KeyFarmer defaultWhat it does
minion-version5The 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
enabledtruefalse stops the type from loading at all
behaviourFARMERThe built in job this type runs. One of FARMER, MINER, LUMBERJACK, HUNTER, FISHERMAN, CHUNK_LOADER, CHUNK_COLLECTOR, FEEDER or SELLER
display-name<yellow>Farmer MinionThe name shown in menus, holograms and messages
descriptionone lineA 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 behaviour needs 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-upgrades leaves 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.

KeyFarmer defaultWhat it does
max-per-player5How 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-fueltrueWhether this type uses fuel. With false the fuel slot and fuel efficiency button leave the menu
max-stored-actions5000The most fuel actions the minion can hold. 0 means no limit
min-delay2The shortest delay between actions this type can ever reach, in seconds. Never lower than 1. The shipped fisherman uses 2 as well
max-range5The largest range this type can ever reach, in blocks. 0 hides the range button
max-storage90The 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-connectionsnot setChunk collectors only. The most minions one collector can ever be paired with, upgrades included. The shipped collector uses 6. See Collector pairing
height1How 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: {}
KeyFarmer defaultWhat it does
per-action1.0How 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
acceptedallall, 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
KeyFarmer defaultWhat it does
repair-costDEFAULTDEFAULT uses breakdowns.repair-cost in config.yml. A section of currency ids with amounts replaces it for this type
repair-cost-per-upgradeDEFAULTDEFAULT uses breakdowns.repair-cost-per-upgrade in config.yml. A section replaces it for this type
repair-itemsDEFAULTDEFAULT 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.

KeyFarmer defaultWhat it does
materialPLAYER_HEADThe item material
heada base64 textureThe head texture shown when the material is PLAYER_HEAD. Each shipped type has its own
name<yellow>Farmer MinionThe item name
lorefour linesThe lines under the name. The shipped files show the level and %upgrades%
custom-model-data0Custom 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-level0The 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:

PlaceholderShows
%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.

KeyWhat it does
materialThe item material. An unknown material skips the item with a warning
amountStack size, 1 when left out. Minion items are always a single item
nameThe item name, in MiniMessage
loreA list of lines under the name
custom-model-dataA whole number for a resource pack model. 0 leaves it off
item-modelAn item model key such as mypack:ruby. A server too old for item models skips it with a warning
flagsA list of item flags, such as HIDE_ENCHANTS
enchantmentsEnchantment names, each with a level, such as sharpness: 2
headA player name, or a base64 texture, for a PLAYER_HEAD
glowtrue adds an enchanted shine without showing an enchantment
itemsadderAn ItemsAdder item id used instead of the material. If ItemsAdder or the item is missing, the material is used
mythicmobsA 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-itemA 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.

KeyFarmer defaultWhat it does
typeVANILLAOne of VANILLA, CUSTOM_MODEL_DATA, ITEMSADDER, MODELENGINE or PROVIDER. An unknown value falls back to VANILLA
providernot setWith PROVIDER, the id of a look another plugin registered through the API
use-mannequintrueWith 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-modelDEFAULTWith 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-data0With 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-slotHEADWhere the custom item goes, HEAD or HAND. Used by CUSTOM_MODEL_DATA and ITEMSADDER
heada base64 textureA player name, or a base64 texture, for the head. The shipped files use the same texture as item.head
armour-colour200,180,60Leather armour colour, written as red,green,blue from 0 to 255. Empty means no armour
handIRON_HOEThe material held in the main hand. With CUSTOM_MODEL_DATA this is also the material of the custom item, PAPER when empty
animationtrueWhether 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-animationidleThe animation played while idle
modelengine.work-animationworkThe 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.speed1.0The speed work, status and event animations play at
modelengine.speed-delay0Above 0, the work animation speed follows the minion's delay, with this many seconds as the delay the animation was made for
modelengine.lerp-in0.1Seconds an animation takes to blend in
modelengine.lerp-out0.1Seconds an animation takes to blend out
modelengine.impact-delay0Ticks between the start of the work animation and the action itself
modelengine.pickup-delay0Ticks the model stays after pickup so the pickup animation can play
motion.styleSWINGThe 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.swings1How many strikes play on each action
motion.turn-to-targettrueWhether the minion turns to face the block or mob it works on
motion.step-distance0.3How far in blocks the minion steps toward what it works on. 0 keeps it in place
motion.turn-ticks3How many ticks turning takes
motion.step-ticks4How 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.

minions/farmer.yml
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_OFFLINE and BROKEN. A status with no entry plays idle-animation. With no entries at all the idle animation simply keeps playing.
  • Action animations are keyed by the kind of action: mine for miners, harvest, plant and till for farmers, chop, plant and gather for lumberjacks, attack for hunters and fish for fishermen. A kind with no entry uses work-animation.
  • Event animations play once over whatever is running. A pickup animation only shows when pickup-delay is above 0, 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: 10 a 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:

minions/farmer.yml
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, idle plays five times as often as idle_stretch. This works for idle-animation, work-animation and every entry under status-animations, action-animations and event-animations.
  • idle-variant-seconds above 0 picks 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-delay above 0 makes 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
KeyWhat it does
rangeBlocks from the minion to the edge of its work area. 1 is a 3x3 area, 2 is 5x5
delaySeconds between actions. Never lower than 1
storageStorage slots
fuel-efficiencyHow much less fuel each action uses, in percent, from 0 to 100. See Fuel
connectionsChunk 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-radiusChunk loaders and chunk collectors only. 1 is just the chunk the minion stands in, 2 is 3x3 chunks, 3 is 5x5 chunks
costWhat it costs to buy the next level, as currency ids from upgrades.yml with an amount each
descriptionLines shown on the Level button while this is the next level. Shipped empty from level 2 up
requirementsPermissions 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: 50

How 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

ValueWhat it does
allAccepts every upgrade in upgrades.yml
a list of idsAccepts only those upgrade ids
allowed-upgrades:
  - storage-1
  - speed

An 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:

KeyTypesWhat it does
block-list.mode, block-list.blocksminer, farmer, lumberjackAn extra OFF, BLACKLIST or WHITELIST list of blocks, checked before the normal list
crops.CACTUS, crops.BAMBOOfarmerWhether cactus and bamboo are cut down to their bottom block
replantlumberjackUPGRADE, ALWAYS or OFF, replacing replant-sapling
sapling-slots, plant-clearance, sapling-spacinglumberjackThe sapling store size and where new saplings may be planted
mode, modeschunk collectorWhat 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.

KeyFarmer defaultWhat it does
enabledtrueWhether this type may use a filter. A type file with no filter section cannot use one
modeACCEPTACCEPT 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.

KeyDefaultLets a trusted player
opentrueOpen the menu
take-storagetrueTake items out of the storage
fueltrueAdd fuel
upgradetrueApply upgrades and buy levels
filtertrueChange the filter
pickupfalsePick the minion up
repairtrueRepair the minion after it breaks down
saplingstrueLumberjack only. Add and take saplings in the sapling store
pairfalseChunk collector only. Pair minions with the collector and unpair them
block-filterfalseMiner, 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.

KeyFarmer defaultWhat it does
enabledtrueWhether the Block filter button shows and the filter is used. Left out, it counts as true
max-entries27The most blocks one minion's list can hold

See Block filter.

hologram

KeyFarmer defaultWhat it does
enabledtrueWhether this type shows a hologram. holograms.enabled in config.yml switches them all off
offset-yDEFAULTHow far above the minion's block the hologram starts. DEFAULT uses holograms.y-offset in config.yml
line-spacing00 keeps every line in one hologram. Above 0, each line is its own hologram, this many blocks apart
linesfour linesThe 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
statesBROKENLines 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-offsets0 eachExtra height for ARMOUR_STAND, MANNEQUIN, MODELENGINE and ITEMSADDER, going by the look the minion really shows
PlaceholderShows
%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.

KeyDefaultWhat it does
stylethe vanilla lookThe 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-styleno boxThe 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:

minions/miner.yml
area-preview:
  enabled: true
  colour: "255,85,85"
  duration: DEFAULT

The keys are the same as in config.yml.

sounds and particles

KeyDefaultWhat it does
sounds.action""Played on every action that has no entry under sounds.actions
sounds.hearing-radius16How 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.ambientno soundA 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:

  • levels
  • item
  • appearance
  • display-name
  • behaviour
  • enabled

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.

On this page