Back to 9Minecraft
Wiki 9Minecraft Wiki 9Minecraft

iCommon API Mod FAQ

10 questions players actually ask, answered.

How do I start using iCommon API Mod in my own mod?
Add iCommon API as a dependency in your mod's build configuration, then import the library classes you need. The mod is designed to work across multiple game versions, so you can use its functions without worrying about version-specific code.
What's the difference between this and just coding version-specific logic myself?
ICommon API abstracts away version differences, so you write your code once and it works across multiple versions automatically. This saves development time and reduces bugs from maintaining separate codebases.
Can I use the YAML Configuration API without understanding YAML?
Yes—the API handles the parsing for you, so you just define your config structure and read/write values through simple function calls. The guides show examples of basic YAML syntax you'll need.
Do I need to manually register event listeners for world and chunk events?
No, the Events system in iCommon API handles registration automatically when you use the provided event classes like WorldChunkInitEvent and ServerWorldInitEvent. You just listen for the events you care about.
How do I detect when a player changes gamemode?
Use the PlayerGamemodeChangeEvent—it fires whenever a player's gamemode changes and gives you access to both the old and new gamemode values. You can cancel the event or run custom logic in response.
What's the Resource and Datapack Metadata API used for?
It lets you read and access metadata from resource packs and datapacks programmatically, so you can check pack versions, dependencies, or custom properties without manually parsing files.
Will using iCommon API slow down my server?
No—iCommon API is a lightweight library that abstracts code without adding overhead. Performance depends on how you use the events and APIs, not on the library itself.
Can I use iCommon API events alongside vanilla events?
Yes, iCommon API events work alongside vanilla events without conflict. You can listen to both in the same mod if needed.
What happens if I load a world with a mod using iCommon API, then remove the mod?
ICommon API doesn't store mod-specific data in worlds by itself—it depends on how your mod uses it. If your mod saves custom data, removing it may cause issues; the API itself won't corrupt your world.
How do I debug if an event isn't firing?
Check that you're listening to the correct event class and that your listener is registered before the event should fire. Use logging statements in your event handler to confirm it's being called, and verify the conditions that trigger the event are actually happening.