Posted October 1, 20168 yr When I load minecraft with any block, It doesn't show up in the creative tabs AND it doesn't work when I type the command "/give (player) mt:(block registry name)". I can tell that it loads because when I comment the code for the block and load the world, it tells me that the block is missing. WTF?
October 1, 20168 yr For the creative tab you have to set it using Block#setCreativeTab(creativeTab) VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
October 1, 20168 yr Author For the creative tab you have to set it using Block#setCreativeTab(creativeTab) It also doesn't show up using commands... I'm pretty sure the creative tab code is okay.
October 1, 20168 yr Is mt your modid? VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
October 1, 20168 yr Is mt your modid? yes Show your code. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
October 1, 20168 yr http://adf.ly/1eSq66 Not a download post it. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
October 1, 20168 yr Author Main: package com.trentmartin2.mt; import com.trentmartin2.mt.proxy.ClientProxy; import com.trentmartin2.mt.proxy.CommonProxy; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.Mod.Instance; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; @Mod(modid = Main.MODID, version = Main.VERSION) public class Main { public static final String MODID = "mt"; public static final String VERSION = "Beta-1.0"; @Instance public static Main instance; @SidedProxy(clientSide = "com.trentmartin2.mt.proxy.ClientProxy", serverSide = "com.trentmartin2.mt.proxy.ServerProxy") public static CommonProxy proxy; @EventHandler public void preInit(FMLPreInitializationEvent event) { System.out.println("Pre Initialization"); ModItems.init(); ModItems.register(); ModBlocks.init(); ModBlocks.register(); } @EventHandler public void init(FMLInitializationEvent event) { System.out.println("Initialization"); proxy.init(); ModCrafting.recipes(); } @EventHandler public void postInit(FMLPostInitializationEvent event) { } } ModBlocks: package com.trentmartin2.mt; import com.trentmartin2.mt.blocks.GodBlock; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraftforge.fml.common.registry.GameRegistry; public class ModBlocks { public static Block godblock; public static void init() { godblock = new GodBlock(); } public static void register() { GameRegistry.register(godblock); } public static void registerRenders() { registerRender(godblock); } public static void registerRender(Block block) { Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(block), 0, new ModelResourceLocation(Main.MODID + ":" + block.getUnlocalizedName().substring(5), "inventory")); } } GodBlock: package com.trentmartin2.mt.blocks; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; public class GodBlock extends Block { public GodBlock() { super(Material.ROCK); this.setUnlocalizedName("godblock"); this.setRegistryName("godblock"); this.setCreativeTab(CreativeTabs.BUILDING_BLOCKS); } }
October 1, 20168 yr Author You are not registering an ItemBlock for your block. This means it can only exist placed down in the world, not in any inventory or as an item entity. how do I fix this?
October 1, 20168 yr When you register your Block register an ItemBlock like so. GameRegistry.register(new ItemBlock(block).setRegistryName(block.getRegistryName())); VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
October 2, 20168 yr Author When you register your Block register an ItemBlock like so. GameRegistry.register(new ItemBlock(block).setRegistryName(block.getRegistryName())); In my ModBlocks class, or my GodBlock class?
October 2, 20168 yr In my ModBlocks class, or my GodBlock class? When you register your Block register an ItemBlock. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
October 2, 20168 yr Hi YOu might find this tutorial project useful https://github.com/TheGreyGhost/MinecraftByExample Look at mbe01. -TGG
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.