Creating Custom Tools with IModularItem Wrappers
Understanding IModularItem
IModularItem is the core interface that makes Tetra tools modular—allowing them to have swappable heads, handles, and other components. TetraModify Core Mod provides code wrappers that simplify working with this interface.
Using Method Wrappers
Instead of directly calling complex IModularItem methods, the wrappers provide cleaner, easier-to-use functions. These are especially useful if you're creating addon content or custom equipment.
Getting Started
1. Understand your tool's structure: Identify which parts of your custom tool should be modular (blade, handle, guard, etc.)
2. Reference the wrapper documentation: Check the mod's code documentation for available wrapper methods
3. Apply wrappers in your addon: Use the provided method wrappers when defining tool behavior, rather than implementing IModularItem directly
4. Test component swapping: Verify that your custom tool parts can be installed and removed correctly in-game
These wrappers reduce boilerplate code and make your addon more stable when interacting with Tetra's modular system.