AutoAppleFarm banner
AutoAppleFarm icon

AutoAppleFarm

Create a Fabric mod for Minecraft 1.21.4 called "AFK Apple Farmer". The mod should automate a single-tree bone meal apple farm in AFK mode: - The farm is at a..

0010 credits
fabricBoth1.21.4mod

AutoAppleFarm - AFK Apple Farmer

Overview

AutoAppleFarm is a Fabric mod for Minecraft 1.21.4 that automates a single-tree bone meal apple farm. It runs silently in the background while you're AFK, planting saplings, growing trees with bone meal, chopping them down, and repeating the cycle automatically.

Features

  • Automated Farm Cycle: The mod automatically plants oak saplings, applies bone meal to grow trees, chops the resulting wood and leaves, then resets for the next cycle.
  • Fixed Farm Location: The farm is located at position (100, 64, 100) - the sapling sits on dirt at (100, 63, 100).
  • State Machine: Uses a 4-state system (Planting → Growing → Chopping → Resetting) for reliable operation.
  • OP Commands: Control the farm with in-game commands.

How to Use

Setup

  1. Make sure you have Fabric loader installed with this mod.
  2. Build a simple apple farm at coordinates around (100, 64, 100):
    • Place dirt at (100, 63, 100)
    • Put a hopper and chest below the dirt to collect dropped items
    • You don't need to place a sapling - the mod does this automatically!

Commands (OP/Admin only - Permission Level 2)

  • /afkfarm set <number> - Set how much bone meal to use. Example: /afkfarm set 64
  • /afkfarm start - Start the farm if you have bone meal set.
  • /afkfarm stop - Stop the farm and reset to the beginning.
  • /afkfarm status - Show current bone meal count and farm state.

Using the Farm

  1. First, use /afkfarm set 64 (or your preferred amount).
  2. Make sure there's a stack of bone meal in a chest connected via hoppers (the mod doesn't provide items - you need to supply them in-world).
  3. Use /afkfarm start to begin the cycle.
  4. Go do something else! The farm will run automatically.
  5. Check the status periodically with /afkfarm status.

Tips & Tricks

  • The farm runs every ~10 ticks (0.5 seconds) to avoid overwhelming the server.
  • Items drop where the blocks are broken - use hoppers underneath to collect everything.
  • The farm stops automatically when bone meal runs out.
  • You can check the status anytime to see how much bone meal remains.

Known Limitations

  • The farm requires bone meal to be available in some form in the world (the mod doesn't spawn items).
  • Works in singleplayer and on servers with the Fabric loader.
  • The fake player system uses direct block breaking rather than a traditional player entity.