Posted January 29, 20187 yr I am trying to register a block, Here is the registry class: @EventBusSubscriber public class BlockInit { public static final ArrayList<Block> blocks = new ArrayList<Block>(); public static final Block theblock = new Block(Material.ROCK).setUnlocalizedName("test").setRegistryName("modid:test"); @SubscribeEvent public void registerBlocks(RegistryEvent.Register<Block> event) { for (Block block : blocks) { System.out.println("Registering block!"); event.getRegistry().register(block); } } @SubscribeEvent public void registerItemBlocks(RegistryEvent.Register<Item> event) { for (Block block : blocks) { event.getRegistry().register( Item.getItemFromBlock(block) .setRegistryName( new ModelResourceLocation(block .getRegistryName(), "Inventory")) .setUnlocalizedName( block.getUnlocalizedName() + "_item")); } } @SubscribeEvent public void modelRegister(ModelRegistryEvent event) { for (Block block : blocks) { block.registerModels(); } } } But it never outprints "Registering block!" I have my proxies but I do not think they need a line for this to work I can usually do this but now I just can't for some reason P.S. the mod loads correctly, no errors no outprints.
January 29, 20187 yr @EventBusSubscriber event handlers need to be static. I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
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.