πΎ Auto-Collector Farm Mod (Fabric)
Mod Type: Minecraft Fabric Mod
Function: Automatically collects drops and XP from broken crops/blocks directly into nearby chests without the use of hoppers.
Why This Mod? Redstone-free farming is one of the most highly searched features in Minecraft modding communities. Many players want to simplify automation without relying on laggy redstone or hopper chains. This mod solves that by using Fabric API's BlockBreakCallback
to collect items seamlessly.
π Features
- ⚡ No redstone or hopper chains required.
- π¦ Items and XP are directly transferred into the nearest chest within a 5-block radius.
- π½ Works with any farmable crop or block that drops items (e.g., wheat, carrots, nether wart, sugar cane).
- π Lightweight and efficient – uses minimal code and Fabric events.
π File Structure
AutoCollectorFarmMod/ ├── src/main/java/com/example/autocollectorfarmmod/ │ ├── AutoCollectorFarmMod.java │ └── AutoCollectorHandler.java ├── src/main/resources/ │ └── fabric.mod.json └── build.gradle
π§ Mod Code
π AutoCollectorFarmMod.java
package com.example.autocollectorfarmmod; import net.fabricmc.api.ModInitializer; public class AutoCollectorFarmMod implements ModInitializer { @Override public void onInitialize() { AutoCollectorHandler.register(); } }
π AutoCollectorHandler.java
package com.example.autocollectorfarmmod; import net.fabricmc.fabric.api.event.player.PlayerBlockBreakEvents; import net.minecraft.block.entity.BlockEntity; import net.minecraft.block.entity.ChestBlockEntity; import net.minecraft.entity.ExperienceOrbEntity; import net.minecraft.item.ItemStack; import net.minecraft.server.world.ServerWorld; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Box; import net.minecraft.world.World; import net.minecraft.util.collection.DefaultedList; import java.util.List; public class AutoCollectorHandler { public static void register() { PlayerBlockBreakEvents.AFTER.register((world, player, pos, state, blockEntity) -> { if (world.isClient || !(world instanceof ServerWorld)) return; Listdrops = Block.getDroppedStacks(state, (ServerWorld) world, pos, blockEntity, player, player.getMainHandStack()); ChestBlockEntity nearestChest = findNearestChest((ServerWorld) world, pos); if (nearestChest != null) { for (ItemStack drop : drops) { insertItem(nearestChest, drop); } } int xp = state.getExpDrop(world, pos, 0, 0); if (xp > 0 && nearestChest != null) { ExperienceOrbEntity orb = new ExperienceOrbEntity(world, pos.getX(), pos.getY(), pos.getZ(), xp); world.spawnEntity(orb); } }); } private static ChestBlockEntity findNearestChest(ServerWorld world, BlockPos pos) { int radius = 5; Box searchBox = new Box(pos).expand(radius); List entities = world.getBlockEntities(searchBox); for (BlockEntity be : entities) { if (be instanceof ChestBlockEntity) { return (ChestBlockEntity) be; } } return null; } private static void insertItem(ChestBlockEntity chest, ItemStack itemStack) { DefaultedList inventory = chest.getInventory(); for (int i = 0; i < inventory.size(); i++) { ItemStack slot = inventory.get(i); if (slot.isEmpty()) { inventory.set(i, itemStack.copy()); return; } else if (ItemStack.canCombine(slot, itemStack)) { int space = slot.getMaxCount() - slot.getCount(); int toTransfer = Math.min(space, itemStack.getCount()); slot.increment(toTransfer); itemStack.decrement(toTransfer); if (itemStack.isEmpty()) return; } } } }
π fabric.mod.json
{ "schemaVersion": 1, "id": "autocollectorfarmmod", "version": "1.0.0", "name": "Auto Collector Farm Mod", "description": "Farms automatically collect drops and XP into chests without hoppers.", "authors": ["YourName"], "contact": {}, "license": "MIT", "environment": "*", "entrypoints": { "main": [ "com.example.autocollectorfarmmod.AutoCollectorFarmMod" ] }, "depends": { "fabricloader": ">=0.14.21", "fabric": "*", "minecraft": "1.20.1" } }
π¦ How to Use
- π§± Build a simple farm with any crop-producing blocks.
- π¦ Place a chest within 5 blocks of where items will drop.
- π¨πΎ Break the crops manually (or let villagers/farm mechanisms do it).
- ✨ Watch as the items and XP fly straight into the chest!
π Tips
- Use barrels or trapped chests if you want storage separation.
- The system works with any block that drops items when broken, not just crops.
- Mod can be extended to work with automated breaking methods (like dispensers or mods).
π‘ Use the Mod for a change!
This mod offers a clean, lag-free solution to auto-collect drops in your farm setups. Whether you're building a massive crop farm or a mob grinder, this drop collector ensures smooth storage without the headache of hopper networks. Perfect for survival worlds, skyblock challenges, or redstone-free automation lovers!
π§© Installation Guide for Auto-Collector Farm Mod
- ✅ Make sure you have Fabric Loader 0.14+ and Minecraft 1.20.1 installed.
- π₯ Download the AutoCollectorFarmMod-1.0.0.jar.
- π Move the downloaded JAR file into your
mods
folder:%appdata%/.minecraft/mods
(Windows)~/.minecraft/mods
(Mac/Linux)
- π Launch Minecraft using the Fabric profile.
- πΎ Break any farm block near a chest (within 5 blocks) and watch items & XP go straight into the chest!
π Advantages of Using the Auto-Collector Farm Mod
- π Redstone-Free Automation: No laggy circuits or complex redstone setups needed.
- π¦ Instant Drop Collection: Items and XP are auto-sent to nearby chests (within 5 blocks).
- π§ Lightweight & Simple: Uses Fabric API, minimal performance impact.
- π Faster Farming: Spend less time collecting, more time expanding your farm.
- π ️ Perfect for Survival & Hardcore: Clean, cheat-free gameplay with enhanced efficiency.
- π Multiplayer Friendly: Works seamlessly on Fabric servers with no extra setup.
Level up your Minecraft farming experience-automate smarter, not harder!
No redstone, no hoppers - just clean and efficient farming magic!
Made with ❤️ for Minecraft 1.20.1 using Fabric.
Comments
Post a Comment