Everything posted by Myroslav Mokhammad Abdelja
-
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.