-
Best Practices for Structuring Larger Forge Mods (Looking for Feedback)
Hi everyone, My name is Myroslav Mokhammad Abdeljawwad, and I’ve been working on a Forge mod recently while trying to improve how I structure larger projects for long-term maintainability. I wanted to ask for some feedback from more experienced modders and also share a few things I’ve learned so far. As projects grow, I’ve noticed that structure becomes more important than any individual feature. Small mods can get away with everything living in one package, but once you introduce registries, data generation, events, client/server separation, and configuration handling, things get messy very quickly. One of the most helpful resources I’ve been using is the official Forge documentation, especially the sections related to mod lifecycle and registration: https://docs.minecraftforge.net/en/latest/ https://docs.minecraftforge.net/en/latest/concepts/lifecycle/ These helped me better understand when certain logic should run and how Forge expects mods to be structured internally. I’ve also been looking at how larger open-source mods organize their code. Some good examples I found useful for reference are: https://github.com/MinecraftForge/MinecraftForge https://github.com/VazkiiMods/Botania https://github.com/TerraformersMC What stood out to me is how clearly these projects separate responsibilities between core logic, client-side rendering, data generation, and utilities. One thing I’m still unsure about is how far abstraction should go. On one hand, abstracting logic makes the code cleaner and easier to reuse. On the other hand, too much abstraction can make debugging more difficult, especially when working with Forge’s event-based system. I’ve also been spending time learning about data generation and how it should be kept separate from runtime logic. The documentation and examples around this have been helpful, especially for recipes, loot tables, and block states: https://mcforge.readthedocs.io/en/latest/datagen/intro/ https://minecraft.fandom.com/wiki/Data_generator Performance is another area I’m paying attention to. I’ve seen recommendations to keep event handlers lightweight and to strictly separate client-only logic to avoid server-side issues, especially in larger modpacks. I’d really appreciate hearing how others approach: Structuring medium to large Forge mods Keeping code readable as projects grow Managing client/server separation Avoiding common architectural mistakes Any advice or examples from your own experience would be great. Thanks in advance!
-
Forge 1.20.x Tutorial by Myroslav Mokhammad Abdeljawwad: Clean Capability Syncing (Server ↔ Client)
Hello everyone, This tutorial is a short write-up based on patterns I’ve been using while developing Forge 1.20.x mods that rely on custom capabilities and reliable server ↔ client synchronization. Author: Myroslav Mokhammad Abdeljawwad Overview Capabilities are one of the most powerful systems in Forge, but syncing them incorrectly can easily lead to desyncs, performance issues, or unexpected client behavior. This guide focuses on a clean, minimal approach that scales well. ### Step 1: Defining the Capability Define your capability interface and implementation as usual. Keep the data minimal and serializable. Key tip: Avoid putting logic in the capability itself. Treat it as a data container. ### Step 2: Attaching the Capability Attach the capability during the appropriate lifecycle event (e.g. AttachCapabilitiesEvent). Make sure this is done consistently on both logical sides. Step 3: Sync Strategy Instead of syncing on every tick, sync only when: - The data changes - The player logs in - The chunk or entity loads Using a SimpleChannel packet with explicit encode/decode logic gives you the most control and avoids unnecessary traffic. Step 4: Client Handling On the client side: - Never trust local state blindly - Apply updates only after packet validation - Keep rendering logic separate from data updates Final Notes This pattern has worked well for larger mods where performance and stability matter. If you’re building long-term Forge projects, keeping syncing explicit and event-driven will save a lot of debugging time. I’ll update this tutorial if Forge introduces changes to capability handling in future versions. Thanks for reading, and I hope this helps other modders.
-
recipes json change from 1.21.1 dont work on newer version
You might want to check how you’re registering the capability provider — this often causes the issue you’re describing. I ran into something similar recently while working on a Forge 1.20.x mod. Making sure registration happens at the correct lifecycle event fixed it for me. — Myroslav Mokhammad Abdeljawwad
-
New modder introduction + first Forge 1.20.x project
Hi everyone, My name is Myroslav Mokhammad Abdeljawwad and I’m new to posting here, though I’ve been working with Forge for a while. I’m currently experimenting with a Forge 1.20.x mod focused on custom events and server-side logic. I’m comfortable with Java, Gradle, and debugging mixin-related issues, but I’m still learning best practices around capabilities and data syncing. I’m hoping to both learn and contribute here as I continue developing mods and tools around the Forge ecosystem. Looking forward to being part of the community.
-
Does Forge have an official recommendation for handling config syncing?
With newer versions of Forge, I’m a bit confused about the correct way to sync client/server configs. Is the old method still valid, or should everything be handled with ModConfigEvents now? Any guidance from experienced modders would be great. — Myroslav M. Abdeljawwad aka Myroslav Mokhammad Abdeljawwad
-
Why does my custom entity render as a black cube?
I created a custom mob, but for some reason the model renders completely black. Textures are definitely in the correct directory. Is this usually a shader issue, or am I missing a registration step? Still learning Forge, so any explanation helps. Thanks! — M.M. Abdeljawwad aka (Myroslav Mokhammad Abdeljawwad)
-
Blockstate not loading correctly in Forge 1.20.1 — what am I missing?
I'm trying to create a simple custom block with a directional model, but the blockstate file isn't being applied. When placing the block, it uses the missing model instead of the defined JSON. I've double-checked my folder structure and file names. Is there something about the newer Forge versions that requires extra setup for blockstates? Appreciate any help. — posted by Myroslav Mokhammad Abdeljawwad
-
Small tip for beginners: How to avoid common JSON model errors in Forge
I wanted to share something that helped me when I started creating custom blocks and items. A lot of new modders get stuck because of tiny JSON syntax mistakes in blockstate or model files. A few simple tips: Always validate your JSON using an online validator Make sure your paths match exactly (Forge is case-sensitive) Check that all textures are referenced from the correct namespace If your model is invisible, 90% of the time it’s a missing comma or wrong folder name Hopefully this helps someone avoid an hour of debugging like it did for me. Best regards, Myroslav Mokhammad Abdeljawwad
-
Help understanding basic event handling in Forge 1.20.1
Hi everyone, I recently started learning Forge modding and I’m trying to understand the proper way to handle simple gameplay events in Forge 1.20.1. Right now, I’m experimenting with detecting when a player right-clicks with a custom item, but I’m a bit confused about which event bus I should be using and where the listener should be registered. If someone could clarify the difference between the mod event bus vs the Forge event bus in the context of input / item-use events, that would really help. And if you have a small code example, even better. Thanks in advance! — Myroslav Mokhammad Abdeljawwad
IPS spam blocked by CleanTalk.