Farming Module
The Farming module lets recruited farmer villagers move items, manage storage, and perform manual crop work inside a controlled work area.
Requirements
Manual farming is active only when all of these are true:
- Farming module is enabled on the server.
- The villager is recruited.
- The villager is in Manual Farming control.
- The villager is not UI-paused.
- Storage is not currently active.
- The villager has an effective workstation.
The villager should be a Farmer for the intended gameplay flow.
Workstation and Work Area
The work area is centered on the effective workstation.
| Workstation Source | Behavior |
|---|---|
| Registered workstation | Used as the authoritative manual farming center. |
| Vanilla job site | Used as fallback when no manual override exists. |
| Manual override with no valid block | Disables fallback and leaves no effective work area. |
The workstation must be in the same dimension as the villager.
Range
Manual farming range is clamped to 1 through 64.
maxRange = manualFarmBaseRange after Ranger stat
effectiveRange = min(playerRequestedRange, maxRange)The work area can be circular or square.
Storage
Villagers can register a deposit chest and a withdraw chest.
- Chests must be in the same dimension.
- Normal chests, trapped chests, barrels, and ender chests are supported in relevant command/storage flows.
- Ender chest storage uses the owning player's ender chest inventory and requires the player context.
- Storage work has timeout and retry settings.
- Storage activity takes priority over manual farming movement.
Deposit Rules
A deposit rule has:
- Item id.
- Trigger threshold in stacks.
- Keep amount in stacks.
When the villager has at least the trigger amount and more than the keep amount, it deposits the excess and keeps the configured reserve.
Withdraw Rules
A withdraw rule uses the same shape:
- Item id.
- Trigger threshold in stacks.
- Keep amount in stacks.
The villager withdraws from storage when its own inventory is below the configured need while preserving the storage keep amount.
"Stacks" are based on each item's max stack size. A rule for an item that stacks to 16 behaves differently from a rule for an item that stacks to 64.
Manual Farming Priority
Manual farming scans every 10 ticks, then picks the first available action in this order:
| Priority | Action | Conditions |
|---|---|---|
| 1 | Bonemeal | Enabled, villager has bonemeal, target crop matches configured plant items, crop is not mature, crop is on farmland. |
| 2 | Pickup | Nearby item entity matches pickup rules, or pickup list is empty and pickup-all is allowed. |
| 3 | Plant | Villager has the first configured plant item available and a valid empty planting base exists. |
| 4 | Harvest | Mature crop drops at least one configured harvest item. |
| 5 | Till | Enabled, villager is holding a hoe, target block is dirt or grass block, and air is above it. |
| 6 | Roam | No work target is available, or it is outside work time. |
The scan searches inside the work range. Block targets scan roughly from 3 blocks below to 3 blocks above the work center, with tighter vertical ranges for bonemeal, harvest, and tilling.
Work Time
Manual farming work happens during a server-configured day window.
- Default runtime window is from day tick
2000to9000. - Motivation expands or contracts the window around its midpoint.
- Outside the work window, the villager roams instead of farming.
- Sleeping prevents work.
Planting
Planting uses configured plant item ids.
- The villager uses the first plant item from the configured list that it has in inventory.
- Normal crops plant on farmland.
- Nether wart plants on soul sand.
- The target block above the planting base must be air.
- Planting records farming history and can grant farming XP progress.
Efficiency on Planting
Efficiency can affect item consumption.
- Positive Efficiency gives a chance to save the seed/item.
- Negative Efficiency gives a chance to consume one extra seed/item.
- The positive save chance is capped to prevent guaranteed free farming.
Bonemeal
Bonemeal is optional and has the highest manual farming priority.
- The crop must be bonemealable.
- The crop must not be mature.
- The crop must match the configured plant crop set.
- The crop must be on farmland.
- The villager consumes bonemeal unless Efficiency saves it.
- Negative Efficiency can consume extra bonemeal.
- Successful bonemeal plays the vanilla growth event and happy villager particles.
- The villager briefly shows bonemeal in the offhand for visual feedback.
Harvesting
Harvesting targets mature crops whose drops include one of the configured harvest items.
- Nether wart is valid on soul sand.
- Other crop targets are expected on farmland.
- Harvest uses a fake player style block break when possible so tool behavior, Fortune, and mod hooks behave closer to a real player harvest.
- If that fails, it falls back to direct block resource drops.
Tilling
Tilling is the lowest-priority work action.
- It requires
manualTillSoilenabled. - The villager must be holding a hoe.
- Dirt and grass block can be turned into farmland.
- The block above must be air.
- Tilling uses the villager's current main hand/tool visuals.
Pickup and Cleanup
Pickup moves item entities into the villager's internal inventory.
- Empty pickup rules mean pickup-all.
- Non-empty pickup rules restrict pickup to those item ids.
- If the inventory is full, the villager marks the action as failed and waits for the retry period.
If "drop other items" is enabled, the villager drops inventory items that are not part of:
- Plant rules.
- Harvest rules.
- Deposit rules.
- Withdraw rules.
Plant Whisperer
Plant Whisperer is a passive farming stat effect.
- It checks on a server-configured interval.
- It looks for nearby bonemealable crops within a small radius around the villager.
- It can grow a crop without consuming bonemeal.
- The base chance is modified by the Plant Whisperer stat.
- The minimum negative stat effect is clamped so the mechanic is not reduced below a useful floor.
Farming XP and History
Manual planting can grant villager XP.
xp = farmingHarvestXp for each farmingHarvestItemsPerXp planted itemsThe mod tracks planted, harvested, bonemealed, deposited, and withdrawn counts. Some counters are split between neutral/vanilla-style farming and manual farming.
Technical note: action failure
Manual farming actions have timeout and retry timers. A failed target does not immediately trap the villager forever; the villager roams and retries later.
Support This Project
Like this wiki and these mods?
Every bit of support helps me keep building features, writing docs, and shipping updates.