Skip to main content

Tree Woodcutter

TreeWoodcutterPlugin is a per-tick MVC woodcutting helper registered in runelite-plugin.properties (config group n3treewc, disabled by default).

Architecture

  • TreeWoodcutterPlugin - lifecycle, overlay XP baseline, delegates ticks to controller.
  • TreeWoodcutterController - pure top-level state machine; chopping remains per-tick, while ordered subflows run through TaskPipeline.
  • TreeWoodcutterWorkflows - package-private Workflow API pipelines for supply recovery, nest pickup, drop/bank/deposit-box output, and fletching.
  • RuneLiteTreeWoodcutterRuntime - live adapter to InteractionApi / sdk.query.
  • WoodcuttingTarget, WoodcuttingAxeTier, FletchingProduct, WoodcuttingInventoryPolicy - data/rules.

Core behavior

onGameTick runs TreeWoodcutterController.onGameTick(). Global ActionPacer is advanced from PacketUtilsPlugin.onGameTick - see Suite Wiring. The plugin registers with Break Handler and stays active there while the controller is not stopped. A due or active break releases the input lock and skips the controller tick before any chop, bank, drop, fletch, or nest action.

State priority (determineState)

  1. Not logged in → WAITING_FOR_LOGIN
  2. Session limit (maxSessionMinutes > 0) → STOPPED
  3. Woodcutting level too low for selected tree (not ANY) → STOPPED
  4. FLETCH guards: members world, not ANY, valid product/level → else STOPPED
  5. Resolve best usable axe (equipped or inventory)
  6. Missing axe/knife → bank supply trip (WALK_TO_BANK / OPEN_BANK / WITHDRAW_SUPPLY)
  7. Return to anchor when away (after banking trips)
  8. Bird nest pickup (members, config enabled) before output/chop
  9. Deposit/bank output when interfaces open and inventory full; FLETCH mode deposits finished products when full and no logs remain
  10. Production UI open → SELECT_FLETCH_PRODUCT
  11. Moving or animating → CHOPPING_WAIT
  12. Logs ready + FLETCH mode → START_FLETCH
  13. Full inventory → DROP / deposit box / bank per OutputMode
  14. Else CHOP_TREE or WAIT_FOR_TREE

Legacy bankLogs = true with outputMode = DROP is treated as BANK (effectiveOutputMode).

Tree names (post-2023-07-12)

Config TreeTypeObject names (lowercase)
NORMALtree, evergreen
OAKoak tree
WILLOWwillow tree
MAPLEmaple tree
YEWyew tree
MAGICmagic tree
ANYunion of all above

Targets must expose the Chop down action (TreeWoodcutterPlugin.CHOP_ACTION).

Output modes

ModeFull inventory behavior
DROPDrop one eligible item per tick (InventoryActions)
BANKPrefer deposit box when closer (config); else nearest bank; one deposit per tick
FLETCHKnife + logs → production UI; deposit fletched products when full

Axes are always protected. Additional names via protectedItems (comma-separated, tag-stripped).

Configuration

  • treeType, radius (anchor search)
  • outputMode, bankLogs (deprecated migration)
  • preferDepositBox, fallbackToBankWhenDepositBoxUnavailable
  • fletchingProduct (FLETCH mode)
  • pickupBirdNests (members)
  • maxSessionMinutes (0 = disabled)
  • protectedItems, showOverlay

Anti-detection note

Tree selection first removes trees without a reachable interaction tile, then ranks the remainder by distance to the captured anchor and path distance from the player. chopNearestTree randomizes only exact-score ties and retains that choice while an interaction is paced. Bird nests stay inside the anchor radius and use path-nearest selection. Deposit-box walking and opening retain the same selected location.

Testing

.\gradlew.bat test --tests com.n3plugins.treewoodcutter.* --console plain
  • TreeWoodcutterDataTest - axe/log/tree predicates, tag stripping
  • TreeWoodcutterControllerTest - controller routing and workflow behavior (login, level, supply cleanup, deposit fallback, nest retry, fletching output)
  • WoodcuttingTargetSelectorTest - anchor/path ranking, unreachable trees, exact ties, and paced target retention
  • RuneLiteTreeWoodcutterRuntimeSelectionTest - nest and deposit-box query policy
  • TreeWoodcutterPluginBaselineTest - overlay XP baseline

Live validation (pending)

Fletch product selection, obstructed tree clusters, multiple visible deposit boxes, deposit box vs bank fallback, nest pickup with full inventory, axe/knife withdrawal, return-to-anchor after banking, session limit stop.