Placing and picking up
How players place a minion, every reason a placement is refused, placement limits and what happens when a minion is picked up.
A minion is an item until it is placed and goes back to being an item when it is picked up. Nothing is lost on the way: the item remembers the level, upgrades and fuel, and picking up never drops anything on the ground.
Placing a minion
Hold the minion item in your main hand and right click a block. The minion stands in the block next to the face you clicked, so clicking the top of a block puts it on top. It turns to face you, snapped to north, east, south or west.
A minion item is never placed as a block, even when its material is a head or another placeable block. The shipped types all use player heads as their items.
The checks run in this order. The first one that fails stops the placement, shows its message and leaves the item in your hand.
| Check | Refused when | Message key |
|---|---|---|
| World | The world is listed under disabled-worlds in config.yml. The default list holds world_the_end | placement.world-disabled |
| Type | The item's type file is missing or has enabled: false. The console also logs a warning naming the player and the type file | placement.unknown-type |
| Spot | The block the minion would stand in is solid or liquid, or the block under it is not solid | placement.bad-spot |
| Free block | Another minion already stands on that block or on the block under it, or is being placed there right now | placement.occupied |
| Distance | Another minion is closer than placement.minimum-distance blocks (default 2). Set it to 0 to switch the check off | placement.too-close |
| Protection | placement.check-protection: true and your protection or claim plugin would not let the player build there | placement.protected |
| Total limit | The player already has as many minions placed as their total limit | placement.limit-reached |
| Type limit | The player already has as many of this type placed as their type limit | placement.type-limit-reached |
| Free in the database | The database already has a placed minion on that block, such as one in a chunk that has not finished loading | placement.occupied |
| Already placed | That exact minion is already standing somewhere else | placement.already-placed |
Another plugin can also cancel a placement through the MinionCore API. That happens without a message from MinionCore.
When every check passes, one minion item is taken from your hand, the place sound and particle play, and the minion starts working. If the minion cannot be set up after that, the placement is undone, the item is given back (or sent to Waiting items when it does not fit) and the player sees placement.failed. The messages themselves are in lang/en_US.yml, see Messages and language.
One minion per block
Two minions can never share a block, however fast players click and whatever placement.minimum-distance is set to, 0 included.
- While one minion is being placed, its block is held for it. Another player who right clicks the same block gets
placement.occupied, and extra clicks from the player who is placing are ignored until the first one finishes. - The database is asked as well, so a minion that is placed but not loaded yet still keeps its block.
- Just before the minion is set up, the block is checked one last time. If another minion got there first, the item is given back, or sent to Waiting items when it does not fit, and the player sees
placement.occupied.
A placed minion also keeps its own block and the block above it clear:
| Refused | How |
|---|---|
| Placing a block there, including beds, doors and other blocks that take two spaces | Cancelled with placement.minion-in-the-way |
| Emptying a bucket of water or lava there | Cancelled with placement.minion-in-the-way |
| A piston pushing or pulling a block into that space | The piston does not move, with no message |
These checks only cover minions that are loaded, which is every minion in a loaded chunk.
Duplicates found at startup
When the server starts, the plugin looks for placed minions that clash, for example from a database written before 1.0.0-3. Two minions clash when they share a block, or when one stands directly on top of the other, since a minion keeps its own block and the one above it clear. For each clash it keeps the minion with the most progress:
- the highest level
- then the most upgrades installed
- then the one placed first
Every other minion in that clash is taken back as a minion item:
- Its database row is switched back to an item, with its storage, fuel, level, upgrades, statistics and settings kept.
- The minion item goes into the owner's claim queue, so the owner collects it from Waiting items in the
/minionmenu. - Its collector pairs and chunk loader tickets are removed, the same as a pick up.
- The console logs one warning for each, naming both minion ids, the world and position, the owner, and the type, level and upgrade count of both minions.
Minions whose type file is missing are left out of this check. After loading, any minion body or hologram left in the world with no placed minion behind it, or a second body for the same minion, is removed, with one line in the console saying how many.
Limits
Two limits apply to every placement.
Total limit, how many minions a player may have placed in all:
- The player's
minioncore.limit.<number>permissions, for exampleminioncore.limit.10. By default every one they hold is added together. Withlimits.mode: HIGHESTonly the largest counts. minioncore.limit.unlimitedorminioncore.limit.*removes the limit.- With no limit permission,
limits.defaultinconfig.ymlapplies (default3). - Reaching it sends
placement.limit-reached, which shows how many are placed across all types.
Type limit, how many of one type a player may have placed:
- The player's
minioncore.limit.<type>.<number>permissions, for exampleminioncore.limit.miner.8, combined the same way. minioncore.limit.<type>.unlimitedremoves it for that type.- With no such permission,
max-per-playerin the type file applies (5for most shipped types,2for the chunk loader and3for the chunk collector). - Reaching it sends
placement.type-limit-reached, which names the type and how many of it are placed.
Chunk loaders and chunk collectors do not count towards the total limit by default. Set limits.count-chunk-loaders: true or limits.count-chunk-collectors: true to count them. Their type limit always applies.
limits:
default: 3
mode: SUM
count-chunk-loaders: false
count-chunk-collectors: falseLimits count minions that are placed, not items in inventories. A player can hold ten miner items and still only place as many as their limits allow. How limits are set per rank is on Limits by rank.
Facing
The way a minion faces is saved with it and kept through restarts. Placing it again after a pick up turns it to face the player who places it. The owner can turn a placed minion with the Facing button (slot 46) in the minion menu: left click turns it clockwise, right click turns it back. Trusted players do not get this button.
Picking a minion up
There are three ways to pick a minion up.
| Way | How | Who may do it |
|---|---|---|
| Shift and right click | Sneak and right click the minion. Works while pickup.shift-right-click: true | The owner, admins with minioncore.admin.bypass, and trusted players when the type allows trusted.pickup |
| Pick up button | Slot 50 in the minion menu | Same as above |
/minion remove | Look at the minion and run the command | The owner or admins with minioncore.admin.bypass. Needs minioncore.remove, which everyone has by default |
Trusted players cannot pick minions up unless you allow it, because trusted.pickup is false in every shipped type file. See Trust and access.
A broken minion cannot be picked up by a player until it is repaired. Any right click, shift and right click included, opens the repair menu, and /minion remove and the Pick up button are refused with breakdown.broken-pickup. Admin removal still works, and the minion is still broken when placed again. See Breakdowns and repairs.
If you shift and right click while holding an upgrade item, the upgrade is applied instead of picking the minion up. Holding fuel does the same on a type that uses fuel, the fuel is added and the minion stays.
The pick up checks
Every way goes through the same checks. If one fails, the minion stays where it is.
- Storage rule. With
pickup.storage: BLOCK, a minion that still has items in its storage is refused (pickup.storage-not-empty). WithMOVE_TO_INVENTORY, the default, this check is skipped. - Room for the item. The minion item must fit in the player's inventory (
pickup.inventory-full). - Room for everything. The minion item and every stored item must all fit together (
pickup.storage-does-not-fit).
The pick up is saved to the database as one change. The minion's row is only switched back to an item while it is still marked as placed, and its storage and statistics are written in the same step. The minion only leaves the world, and items are only handed over, after that save has worked. While it runs, or while a minion that just loaded is still reading its storage, menus, clicks and commands on it are refused with general.minion-busy. If the database cannot save the pick up, the minion stays where it is with its storage and statistics, keeps working, and the player sees pickup.failed.
pickup:
shift-right-click: true
keep-fuel-on-pickup: true
storage: MOVE_TO_INVENTORYWhat happens to everything
- The minion item keeps the level, every applied upgrade and the fuel left. With
pickup.keep-fuel-on-pickup: false, the fuel is cleared instead. - Stored items go into the player's inventory with the minion item. A lumberjack's sapling store is handed over the same way.
- Stored experience, collected when
output.collect-experience: true, is given straight to the player. - Statistics, the filter, trusted players and settings such as a collector's mode stay with that minion and are back when it is placed again.
- Collector pairs. Picking up a minion that is paired with a chunk collector removes the pair. Picking up a chunk collector keeps its pairs, so they work again once it is placed.
- Nothing is dropped on the ground. If something no longer fits by the time it is handed over, it waits under Waiting items in the
/minionmenu. See Shop and claims.
When an admin removes minions with /minion admin remove, the items go to the owner instead, straight into their inventory when they are online and into Waiting items when they are not. The storage rule still applies, and a minion whose owner is online without enough room is left in place. Removing a chunk collector this way also deletes its pairs. See Admin tools.