How slexom/animal-feeding-trough works
Project type and purpose
• This is a multi-platform Minecraft mod (“Animal Feeding Trough”) that uses the Architectury API to share a common codebase while targeting both Fabric and NeoForge (Forge-compatible) mod loaders.
• Its purpose is to let mobs automatically find and use a feeding trough in world, triggering feed/breed behavior.
File structure
• Top-level modules:
• common/ – core Java code and resources shared across platforms
• fabric/ – Fabric-specific entrypoints and metadata
• neoforge/ – NeoForge-specific entrypoints and metadata
• common/src/main/java/slexom/animal_feeding_trough:
• AnimalFeedingTroughMod.java – common mod initializer via Architectury
• block/FeedingTroughBlock.java, block/entity/FeedingTroughBlockEntity.java – block+tile-entity definitions
• inventory/BlockEntityInventory.java – custom inventory logic
• goal/entity/ai/SelfFeedGoal.java – AI goal for mobs
• mixin/… – Mixin classes to inject into Minecraft’s AnimalEntity & GoalSelector
• screen/FeedingTroughScreen(.java) & FeedingTroughScreenHandler.java – GUI and screen handler
• common/src/main/resources:
• assets/… – blockstates, models, textures, lang files
• data/… – recipes, loot tables, advancements
• mixins.animal_feeding_trough.json – Mixin config
• fabric/ and neoforge/ each contain:
• platform entrypoint classes registering the common mod
• loader metadata (fabric.mod.json, neoforge.mods.toml)
• build scripts:
• root build.gradle, settings.gradle, gradle wrapper
• module-specific build.gradle files
README for additional insights
• Confirms this is an Architectury mod, versioned 1.1.2, supporting multiple MC versions.
Essential architectural elements
• Don’t omit the Mixin mechanism—it’s key to how the mod alters vanilla behavior.
• Resource pipelines (assets, data) feeding into the engine.
• Separate UI (FeedingTroughScreen) from server-side logic (AI goal, block entity).