trentmartin2 Posted October 1, 2016 Posted October 1, 2016 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? Quote
Animefan8888 Posted October 1, 2016 Posted October 1, 2016 For the creative tab you have to set it using Block#setCreativeTab(creativeTab) Quote 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.
trentmartin2 Posted October 1, 2016 Author Posted October 1, 2016 On 10/1/2016 at 10:32 PM, Animefan8888 said: 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. Quote
trentmartin2 Posted October 1, 2016 Author Posted October 1, 2016 Also, there are 0 errors in the console. Quote
Animefan8888 Posted October 1, 2016 Posted October 1, 2016 Is mt your modid? Quote 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.
trentmartin2 Posted October 1, 2016 Author Posted October 1, 2016 On 10/1/2016 at 10:49 PM, Animefan8888 said: Is mt your modid? yes Quote
Animefan8888 Posted October 1, 2016 Posted October 1, 2016 On 10/1/2016 at 10:50 PM, trentmartin2 said: Quote Is mt your modid? yes Show your code. Quote 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.
Animefan8888 Posted October 1, 2016 Posted October 1, 2016 On 10/1/2016 at 10:59 PM, trentmartin2 said: http://adf.ly/1eSq66 Not a download post it. Quote 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.
trentmartin2 Posted October 1, 2016 Author Posted October 1, 2016 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); } } Quote
trentmartin2 Posted October 1, 2016 Author Posted October 1, 2016 On 10/1/2016 at 11:18 PM, diesieben07 said: 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? Quote
Animefan8888 Posted October 1, 2016 Posted October 1, 2016 When you register your Block register an ItemBlock like so. GameRegistry.register(new ItemBlock(block).setRegistryName(block.getRegistryName())); Quote 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.
trentmartin2 Posted October 2, 2016 Author Posted October 2, 2016 On 10/1/2016 at 11:49 PM, Animefan8888 said: 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? Quote
Animefan8888 Posted October 2, 2016 Posted October 2, 2016 On 10/2/2016 at 12:13 AM, trentmartin2 said: In my ModBlocks class, or my GodBlock class? Quote When you register your Block register an ItemBlock. Quote 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.
TheGreyGhost Posted October 2, 2016 Posted October 2, 2016 Hi YOu might find this tutorial project useful https://github.com/TheGreyGhost/MinecraftByExample Look at mbe01. -TGG Quote
Recommended Posts
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.