This is an old revision of the document!
Table of Contents
Adding an Block
Introduction
Like items, new blocks are added by most mods. You'll need to create an Item, register it and give it a texture/textures. To add additional behavior to the block you will need a Block class.
Registering an Block
As blocks exist in vanilla, they are added with the vanilla registry that can be gotten by using Registry.register. The first parameter defines what should be registered, so for blocks its Registry.BLOCK. The second parameter is the name of the block, in the form of an Identifier object. Create one with new Identifier (modid, name) where modid is the id of the mod and name is the block's name. Finally, the third parameter takes in the block that you want to register. Example: Registry.register(Registry.BLOCK, new Identifier(“example”, “test_block”), testBlock)