MinionCore logoMinionCore

Lumberjack

How the lumberjack minion finds real trees, cuts them top down, replants and plants saplings, and leaves log builds alone.

The lumberjack cuts trees around it and keeps the logs in its storage. In its default mode it only cuts real trees, so you can place one near a log cabin without losing the walls.

Three panels. A natural tree whose leaves touch the trunk is cut top down with the logs numbered one to six from the top. After the last log a sapling from the sapling store is planted where the trunk stood. A log house with no natural leaves is marked as left alone.

Modes

settings:
  mode: TREE
ValueWhat it does
TREEFollows connected logs, checks that they form a real tree, and cuts the tree from the top down. This is the default.
RADIUSCuts any configured log in its area, one block per action, with no tree check at all.

RADIUS does not check for leaves, so it will cut logs out of player builds in its area. Use it only in a space set aside for the minion, or protect builds with the block list.

The area is the range of the current level in every direction and height blocks up and down. The shipped minions/lumberjack.yml uses a height of 6, so it reaches the top of most trees.

The tree rule

In TREE mode, when the lumberjack finds a log it looks at every log of the same wood that touches it, including diagonally, and treats that group as one possible tree. The group only counts as a tree when all of these are true:

  • Natural leaves of the same wood touch it. Oak logs need oak leaves, spruce needs spruce leaves and so on. Azalea leaves count for oak, nether wart blocks for crimson stems and warped wart blocks for warped stems. Leaves directly above the top log count too, up to six blocks up with only air in between.
  • The leaves are natural. Leaves placed by a player do not count, so hanging a few leaves on a log wall does not turn it into a tree.
  • The group is not too big. A group with more logs than max-tree-size is left alone completely.
settings:
  max-tree-size: 256
  require-leaves: true
KeyDefaultWhat it does
max-tree-size256The most logs one tree may have. Bigger groups are skipped.
require-leavestrueWhether the leaves check is used. With it off, any connected group of logs within the size limit is cut.

Once a tree is confirmed, the lumberjack cuts its highest log first and works down one log per action. It remembers that the logs belong to a tree, so it keeps going even if the leaves start to decay part way through. Logs of the tree that sit outside the area are not cut.

Player houses

A log house, a fence of logs or a wooden pillar has no natural leaves on it, so it fails the tree check and is never touched in TREE mode. This is the reason require-leaves is on by default. Turn it off only if the area holds nothing but trees.

Which logs count

settings:
  logs:
    - OAK_LOG
    - SPRUCE_LOG
    - BIRCH_LOG
    - JUNGLE_LOG
    - ACACIA_LOG
    - DARK_OAK_LOG
    - MANGROVE_LOG
    - CHERRY_LOG
    - CRIMSON_STEM
    - WARPED_STEM
  include-all-logs: true
KeyDefaultWhat it does
logsthe list aboveThe logs this minion cuts.
include-all-logstrueAlso cuts every other log the server knows, including woods added in newer Minecraft versions, stripped logs and wood blocks.

Set include-all-logs: false if you want the logs list to be the only thing that counts, for example a lumberjack type that only cuts birch.

Custom logs

Logs from ItemsAdder go in the same logs list as itemsadder:namespace:id. They follow the same connected log walk in TREE mode and are cut top down. Because a custom wood cannot be matched to its own leaves, leaves of any kind count, including leaves a player placed, as long as they touch the logs or sit just above the top log. Custom logs are never replanted, and no saplings are picked up for them. If ItemsAdder is not installed, these entries are skipped with a warning.

Replanting saplings

settings:
  replant: UPGRADE
  sapling-slots: 9
  plant-clearance: 5
  sapling-spacing: 3

replant decides whether the lumberjack looks after its trees once they are cut.

replantWhat it does
UPGRADEReplants only once the auto-replant upgrade is applied. This is the shipped value.
ALWAYSReplants without any upgrade.
OFFNever replants, plants or picks up saplings.

Replanting only happens in TREE mode, and only for woods that have a sapling. Any other value logs a warning and counts as UPGRADE.

Files from 1.0.0-1 had replant-sapling: true or false instead. When the file updates, true is moved to replant: ALWAYS and false to replant: OFF, so an existing lumberjack keeps doing what it did. A file that has replant-sapling but no replant is read the same way.

The auto replant upgrade

The shipped auto-replant entry in upgrades.yml has the kind REPLANT, is only for lumberjacks and can be applied once. It is only accepted by a type in TREE mode with replant: UPGRADE. On a type set to ALWAYS or OFF it is refused as the wrong type. See Levels and upgrades.

The sapling store

While a lumberjack is replanting, its minion menu shows a Saplings button (slot 20). It opens the sapling store, a small inventory kept apart from the normal storage. sapling-slots sets how many slots it has, from 1 to 45, and the menu gets one row per 9 slots plus a row for its buttons.

  • Click a slot while holding saplings, or shift click saplings in your own inventory, to put them in.
  • Click a stored stack to take it, or right click to take half.
  • Only plain saplings of a wood this minion cuts go in. Anything else shows saplings.not-a-sapling, a full store shows saplings.full, and a lumberjack that is not replanting shows saplings.not-replanting.

Using the store needs the saplings access. The owner always has it, and trusted players have it while trusted.saplings is true, as it is in the shipped file. The help book (bottom row, column 0) and back button (column 4) are set under saplings in gui.yml. See Menus.

When the lumberjack is picked up, the saplings in the store are handed over with the rest of its storage.

Where saplings come from

Cutting logs does not drop saplings, so the lumberjack gathers them itself. While it is replanting, every action also picks up sapling items lying on the ground in its work area, such as saplings from decaying leaves. When there is no tree left to cut but saplings are lying around, the minion still takes an action just to pick them up.

  • Saplings go into the sapling store first. What does not fit goes into the normal storage, as long as the filter accepts it and there is room.
  • Only saplings for the woods it cuts are picked up. With include-all-logs: true that is every wood the server knows.
  • Saplings a player just threw are left until they can be picked up normally. Items that belong to a player are left alone.
  • Data other plugins put on an item only keeps it on the ground when that plugin is listed in ground-items.protected-plugins in config.yml, and a scoreboard tag only does when it is listed in ground-items.protected-tags. Both lists are shared with ground collectors and ship empty, so a sapling tagged by ItemsAdder or another plugin is picked up like any other.
  • With RoseStacker installed, a stacked pile of saplings is taken at its real size, as much as fits, and the rest stays in the stack. See Items stacked by RoseStacker.

Players can also throw saplings next to the minion, or put them straight into the store.

Replanting a cut tree

When the last log of a tree is cut, the lumberjack plants a sapling where the trunk stood, taken from the sapling store first and then from storage. If it has none, nothing is planted and the minion carries on.

  • Each wood gets its own sapling. Mangrove gets a propagule, and crimson and warped stems get their fungus.
  • The spot has to be empty or hold ground cover (see below), with dirt, grass, podzol, moss, mud or nylium under it.

For trees with a two by two trunk, such as dark oak and giant spruce, the lumberjack remembers every base block of the trunk while it cuts. When the last log is gone it plants a sapling on each base position, so the tree can grow back at full size. It needs one sapling for each position. If it runs out part way, it plants as many as it has.

Planting new trees

When there is no log to cut, a replanting lumberjack that holds saplings plants one new tree per action. It tries up to 8 random spots in its area. A spot is used when all of these are true:

  • It is the top of the ground in that column, inside the work area and its height.
  • There are plant-clearance blocks of air above it (1 to 32, shipped 5), and no minion stands in that column.
  • No log, leaves or sapling is within sapling-spacing blocks sideways (0 to 16, shipped 3), so trees do not grow into each other.
  • The ground is a dirt kind of block, such as dirt, grass, podzol, moss or mud. Mycelium is never used. A mangrove propagule can also go on clay.
  • The ground is not the block a minion stands on, and not named in a BLACKLIST block list.

Ground cover does not get in the way. Short grass, tall grass, ferns, large ferns, dead bushes, vines, snow layers, tall flowers such as sunflowers and lilacs, and the other blocks the game lets a block or a growing tree replace count as empty, both for the planting spot and for the clearance above it. The lumberjack clears the plant, both halves of a tall one, and puts the sapling in its place. Water, lava, fire, seagrass and kelp never count as empty, and neither do leaves. Small flowers such as dandelions are not ground cover either, so a spot with one on it is skipped. The same applies when a cut tree is replanted.

Crimson and warped fungus are never planted this way. Dark oak and pale oak saplings need four saplings and a free two by two square, and are planted as a square. The trees then grow naturally, and the lumberjack cuts them once they are real trees.

Block list

settings:
  block-list:
    mode: OFF
    blocks: []

The block list is checked before the logs list.

modeWhat it does
OFFThe list is not used. This is the shipped value.
BLACKLISTBlocks named in blocks are never cut, and saplings are never planted on ground named in blocks.
WHITELISTOnly blocks named in blocks are cut, and they still have to count as logs.

Entries are block names or custom blocks written as itemsadder:namespace:id. A mode other than the three above logs a warning and switches the list off, and a name that is not a block on your version is skipped with a warning.

Players can also narrow this down per minion with the block filter, which is checked after this list.

In RADIUS mode there is no tree check, so the block list is the way to keep wooden builds safe. For example, a WHITELIST with only SPRUCE_LOG lets a spruce farm run next to an oak cabin.

Whatever either list says, the lumberjack never cuts a block that holds data, such as a chest or sign, and never cuts the block a minion stands on.

The tool and order

settings:
  order: NEAREST
  tool:
    material: DIAMOND_AXE
    enchantments:
      fortune: 0
      silk_touch: 0

Drops are worked out as if this axe broke the log. order picks which tree is started first: NEAREST for the closest one, RANDOM for a random one. A missing tool section means a plain diamond axe.

On this page