Register a Custom Block with KasugaLib
Setting Up Block Registration
KasugaLib simplifies block registration by handling the boilerplate code automatically. To register a custom block, you'll need to define your block class and use KasugaLib's registration helpers in your mod's setup phase.
Steps
1. Create your block class extending Minecraft's Block class with your desired properties (hardness, blast resistance, sound type, etc.)
2. Call KasugaLib's block registry method during your mod's initialization, passing your block instance and a unique identifier string
3. KasugaLib automatically handles blockstate JSON generation and texture path registration, removing the need for manual texture path configuration
4. Define your block's appearance through standard Minecraft texture folders—KasugaLib will locate and apply them without extra path setup
5. If your block has a block entity (for storage or functionality), register it alongside your block using the provided block entity registry helper
KasugaLib manages all network synchronization and registration event handling behind the scenes, so your block will work correctly in multiplayer without additional networking code. Test your block in creative mode first to verify appearance and behavior before using it in survival.