Posted October 23, 20205 yr Since I am using a translator, my English may be unnatural. sorry. This may be a rudimentary and ridiculous mistake, but the texture and model of the block will appear as black and purple blocks. Also, the name of the block item is displayed as Air. public class TestBlock extends Block{ public TestBlock() { super(Properties.create(Material.WEB, MaterialColor.WOOL).hardnessAndResistance(2.0F, 3.0F).sound(SoundType.CLOTH)); setRegistryName("test_block"); } } public class TestBlockItem extends BlockItem{ public TestBlockItem() { super(new TestBlock(), new Item.Properties().group(DepressionMod.DEPRESSIONMOD_TAB)); this.setRegistryName(new TestBlock().getRegistryName()); } } @ObjectHolder(DepressionMod.MOD_ID) public class DepressionModRegistry { @Mod.EventBusSubscriber(modid = DepressionMod.MOD_ID, bus = Bus.MOD) public static class Register { //Blocks public static final Block TEST_BLOCK = new TestBlock(); //BlockItems public static final BlockItem _TEST_BLOCK = new TestBlockItem(); //TileEntities //public static final TileEntityType<RedstoneCapacitorTileEntity> CHARGED_CAPACITY_TILEENTITY = TileEntityType.Builder.create(RedstoneCapacitorTileEntity::new, REDSTONE_CAPACITOR_BLOCK).build(null); //ItemRegistry /* @SubscribeEvent public static void registerItems(RegistryEvent.Register<Item> event) { final Item[] items = { new SilverIngotItem() }; event.getRegistry().registerAll(items); } */ //BlockRegistry @SubscribeEvent public static void registarBlocks(RegistryEvent.Register<Block> event) { final Block[] blocks = { TEST_BLOCK }; event.getRegistry().registerAll(blocks); } //BlockItemRegistry @SubscribeEvent public static void registarBlockItems(RegistryEvent.Register<Item> event) { final BlockItem[] blockitems = { _TEST_BLOCK }; event.getRegistry().registerAll(blockitems); } } }
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.