MinecraftScripterAI
Discord ↗
Link Copied to Clipboard
×
"create a block"
/* To create a block in Minecraft Forge, first define the block in a class, then register it. Here's an example: */ // Define the custom block class public class CustomBlock extends Block { public CustomBlock(AbstractBlock.Properties properties) { super(properties); } } // In your main mod class or a separate registry class, register the block public static final RegistryObject<Block> CUSTOM_BLOCK = BLOCKS.register("custom_block", () -> new CustomBlock(Block.Properties.of(Material.STONE).strength(4f, 1200f).requiresCorrectToolForDrops())); // Make sure to add the block to your mod's item group for it to appear in the creative inventory public static final RegistryObject<Item> CUSTOM_BLOCK_ITEM = ITEMS.register("custom_block", () -> new BlockItem(CUSTOM_BLOCK.get(), new Item.Properties().tab(YOUR_ITEM_GROUP)));