Minion types
The nine built in behaviours, how type files work, how to make your own type and how a minion can look.
A minion type is one file in plugins/MinionCore/minions. The file picks what the minion does, what it is called, what it costs to level up and how it looks. MinionCore ships nine, one for each built in behaviour, and you can add as many more as you like by copying a file.
The built in behaviours
The behaviour key at the top of a type file picks one of these.
behaviour | Shipped file | What it does |
|---|---|---|
MINER | miner.yml | Mines the listed blocks around it. See Miner |
FARMER | farmer.yml | Harvests the crops around it. See Farmer |
LUMBERJACK | lumberjack.yml | Chops the trees around it. See Lumberjack |
HUNTER | hunter.yml | Attacks the mobs around it. See Hunter |
FISHERMAN | fisherman.yml | Fishes the water around it. See Fisherman |
CHUNK_LOADER | chunkloader.yml | Keeps the chunks around it loaded. See Chunk loader |
CHUNK_COLLECTOR | chunkcollector.yml | Collects the items of the minions paired with it, or dropped items in the chunks around it. See Chunk collector |
FEEDER | feeder.yml | Refuels the minions around it from its own fuel stock. See Feeder |
SELLER | seller.yml | Sells the items in a linked container or its own storage and pays its owner. See Seller |
The shipped chunk loader, chunk collector and feeder do not use fuel (requires-fuel: false). The other six do.
The file name is the type id
The type id is the file name without .yml, in lower case. miner.yml is the type miner, and a file called diamond-miner.yml is the type diamond-miner.
A file whose name only differs in upper and lower case from a shipped file, such as Miner.yml, is skipped, so it cannot hide the shipped type.
That id is what you type in commands and permissions:
/minion give Steve diamond-minergives the minion item.minioncore.limit.diamond-miner.10lets a player place ten of that type. See Placing and picking up.typeslists infuel.ymlandupgrades.ymluse it to allow a fuel or upgrade on that type only.
Renaming a type file changes its id. Minions already placed under the old id no longer match any type and are left out with a console warning, so pick the name before players start placing them.
Making a new type
A new type is a copy of an existing file with a few values changed. For example, a miner that only mines diamond ore:
Copy the file
Copy minions/miner.yml to minions/diamond-miner.yml.
Change what makes it different
Keep behaviour: MINER, then change the name and the block list.
behaviour: MINER
display-name: "<aqua>Diamond Miner"
item:
material: DIAMOND_PICKAXE
name: "<aqua>Diamond Miner"
settings:
blocks:
- DIAMOND_ORE
- DEEPSLATE_DIAMOND_OREAdjust levels, max-per-player and anything else you want while you are there. Every key is explained on Minion type files.
Reload
Run /minion reload. The console lists how many types were loaded, and /minion give <player> diamond-miner now works. Add it to shop.yml if players should be able to buy it.
A type is skipped with a console warning when behaviour is missing or not one of the names above, or when it has no usable levels. To switch a type off without deleting it, set enabled: false. Minions of a switched off type that are already placed are left out until you switch it back on. Deleting one of the nine shipped files does not work, because MinionCore writes it again on the next start.
How a minion looks
Each type file has an appearance section, and appearance.type picks one of four looks.
appearance.type | What players see | Keys it uses |
|---|---|---|
VANILLA | A player model wearing coloured leather armour and holding an item, with the owner's skin or the type's head. The default | use-mannequin, use-owner-skin-when-no-model, head, armour-colour, hand |
CUSTOM_MODEL_DATA | An armour stand wearing or holding an item with your resource pack's model | custom-model-data, item-model, custom-model-slot, hand |
ITEMSADDER | An armour stand wearing or holding an ItemsAdder item | itemsadder, custom-model-slot |
MODELENGINE | A ModelEngine model with idle and work animations | modelengine.model, modelengine.idle-animation, modelengine.work-animation |
Heads
Each shipped type has its own head texture: a helmet for the miner, a hat for the farmer, a cap for the lumberjack, a hat for the fisherman, a wolf hide for the hunter, a globe for the chunk loader, a hopper for the chunk collector, and their own heads for the feeder and the seller. The same base64 texture is used twice in each file:
item.material: PLAYER_HEADwithitem.head, so the minion item in inventories, the shop and menus shows the head.appearance.head, so the placed minion wears it when it does not wear its owner's skin.
Change both to give a type a different look. A minion item is never placed as a block, so a head item stays a minion. Menu entries with icon: TYPE in gui.yml copy the type's item, head included. See Menus.
VANILLA, Mannequin or armour stand
With appearance.type: VANILLA and use-mannequin: true, Spigot and Paper servers that have the Mannequin entity (1.21.9 and newer, and the whole 26.x line) show the minion as a half size player model with a real player skin, the owner's or the one from head. Older servers, or use-mannequin: false, get a small armour stand instead, wearing that skin as a player head. Since 1.1.0 Paper and its forks show Mannequins too. Before that they always used the armour stand. Both wear leather armour in armour-colour and hold the hand item.
headis a player name or a base64 texture.armour-colouris written asred,green,blue, for example"80,80,80".animation: trueswings the arm on every action.
The owner's skin
A minion with the VANILLA look can wear its owner's skin instead of the type's head, so every player's minions look like them. It is on by default.
appearance:
use-owner-skin-when-no-model: trueappearance:
type: VANILLA
use-owner-skin-when-no-model: DEFAULT| Where | Value | What it does |
|---|---|---|
config.yml | true or false | The setting for every type that does not choose for itself. Shipped as true |
| Type file | DEFAULT | Follows config.yml. Every shipped type file uses this |
| Type file | true or false | Overrides config.yml for this type only |
Any other value in a type file logs a warning and counts as DEFAULT.
On a Mannequin the whole player model wears the skin. On an armour stand, on servers older than 1.21.9 or with use-mannequin: false, the stand wears the owner's head. The armour, hand item and everything else stay as the type file sets them.
Only the VANILLA look uses it. CUSTOM_MODEL_DATA, ITEMSADDER and MODELENGINE types never wear the owner's skin, even when an ITEMSADDER or MODELENGINE look falls back to the vanilla body because its plugin or model is missing. The minion item and the menu icons always keep the type's head.
The skin is looked for in this order, and the first one found is used:
- SkinsRestorer, when it is installed: the skin SkinsRestorer has for the owner, including one they set with its
/skincommand. - The owner's own skin, while the owner is online.
- The owner's profile, looked up in the background on a server with
online-mode=true. - The type's
head, when none of the above has a skin, for example for an offline owner on an offline mode server without SkinsRestorer.
The skin is fetched in the background and kept in memory per owner. Until it arrives, the minion shows the type's head for a moment. The skin is fetched again when the owner joins, on /minion reload, and when SkinsRestorer changes the owner's skin, and the minion is only put back when the skin really changed. Nothing needs setting up for SkinsRestorer, see Installation.
CUSTOM_MODEL_DATA
The minion is an armour stand with one custom item on its head or in its hand, picked by custom-model-slot: HEAD or HAND. The item is the hand material (paper when hand is empty) with custom-model-data on it. item-model puts an item model key on the same item, alongside or instead of custom-model-data, and only works on 1.21.4 and newer. On older servers it is skipped with a console warning.
ITEMSADDER
The minion is an armour stand wearing or holding the ItemsAdder item in itemsadder, placed by custom-model-slot. If ItemsAdder is not installed or the item does not exist, a warning is logged and the minion gets the VANILLA look instead, so with use-mannequin: true it is a Mannequin on servers that have one.
MODELENGINE
The minion carries the ModelEngine model named in modelengine.model on a hidden stand. It plays idle-animation while idle and work-animation on each action when animation is on. If ModelEngine is missing or the model id does not exist, a warning is logged once and the minion gets the VANILLA look instead, so with use-mannequin: true it is a Mannequin on servers that have one.
Whatever the look, minions cannot be hurt, set on fire, leashed or have their items taken, and the hologram above them is set separately under hologram in the same file, with its own height for each look. See Holograms and effects.
Changing the appearance section and running /minion reload puts every placed minion of that type back with the new look. See Admin tools.