Posted February 21, 201510 yr I have managed to create a block but i cant for the life of me manage to get the blocks item models to work and I dont see what im doing wrong. Heres my blocks item model if it helps: { "parent": "tm:block/block_MachineCore", "display": { "thirdperson": { "rotation": [ 10, -45, 170 ], "translation": [ 0, 1.5, -2.75 ], "scale": [ 0.375, 0.375, 0.375 ] } } } And here is the registry for the item model: http://pastebin.com/nwErv1Qu p.s this was in a previous topic but I deleted it because it got too long and it was not going anywhere. BioWarfare Mod: http://goo.gl/BYWQty
February 21, 201510 yr Do you have a blockstates file? You have to have a .json in assets/modid/blockstates with the same name as you register it in GameRegistry.registerBlock Refer to vanilla blockstates files for more.
February 21, 201510 yr Author Yes i have done that here is how i did it: { "variants": { "normal": [ { "model": "BioWarfare:block_MachineCore" }, { "model": "BioWarfare:block_MachineCore", "y": 90 }, { "model": "BioWarfare:block_MachineCore", "y": 180 }, { "model": "BioWarfare:block_MachineCore", "y": 270 } ] } } BioWarfare Mod: http://goo.gl/BYWQty
February 21, 201510 yr You're trying to set multiple models for one state. Although I do not think this is the main issue this will cause a problem. The torch json is as follows. { "variants": { "facing=up": { "model": "normal_torch" }, "facing=east": { "model": "normal_torch_wall" }, "facing=south": { "model": "normal_torch_wall", "y": 90 }, "facing=west": { "model": "normal_torch_wall", "y": 180 }, "facing=north": { "model": "normal_torch_wall", "y": 270 } } } You need to put logic in any methods referring to getting the block state to determine what the "facing" value will be and set the variants accordingly. Take a look at BlockTorch
February 21, 201510 yr Author is: { "variants": { "normal": {"model": "BioWarfare:block_MachineCore"} } } better? BioWarfare Mod: http://goo.gl/BYWQty
February 21, 201510 yr Yes, however your block won't rotate how you would like it to after that, if you just want a normal block that faces one direction only that should work fine.
February 21, 201510 yr Author Ok so anything else that is wrong? BioWarfare Mod: http://goo.gl/BYWQty
February 21, 201510 yr Not really enough code to determine that. Where is it being run from, you should have a client proxy with a method kind of like the following: @Override public void registerRenderThings() { ItemModelMesher mesher = Minecraft.getMinecraft().getRenderItem().getItemModelMesher(); String id = Reference.MOD_ID.toLowerCase(); mesher.register(GameRegistry.findItem(id, "connected_polished_granite"), 0, new ModelResourceLocation(id + ":connected_polished_granite", "inventory")); mesher.register(GameRegistry.findItem(id, "connected_polished_andesite"), 0, new ModelResourceLocation(id + ":connected_polished_andesite", "inventory")); mesher.register(GameRegistry.findItem(id, "connected_polished_diorite"), 0, new ModelResourceLocation(id + ":connected_polished_diorite", "inventory")); } proxy.registerRenderThings(); Should be called in the init portion of the mod after blocks are registered.
February 21, 201510 yr Author yes i have that too: Blocks registry class: http://pastebin.com/y7e8Cu97 Also: @EventHandler public void preInit(FMLPreInitializationEvent event) { BioWarfareBlocks.init(); BioWarfareBlocks.register(); And: @EventHandler public void Init(FMLInitializationEvent event) { Proxy.registerRenderThings(); And finally: public class ClientProxy extends CommonProxy { public void registerRenderThings() { BioWarfareBlocks.registerRenders(); BioWarfareBlocks.registerRenders(); BioWarfare Mod: http://goo.gl/BYWQty
February 21, 201510 yr Author oh woops i've changed that now but it still wont work anything else? BioWarfare Mod: http://goo.gl/BYWQty
February 22, 201510 yr Author anything else that could be causing this? BioWarfare Mod: http://goo.gl/BYWQty
February 23, 201510 yr Author Has no buddy else ran into this problem? BioWarfare Mod: http://goo.gl/BYWQty
September 22, 201510 yr You get the item model to work by creating a <blockname>.json in models/item. Think of it as when you place your block in the world it is a block, but when it is in your inventory it is actually an item. { "parent": "<modname>:block/<blockname>", "display": { "thirdperson": { "rotation": [ 10, -45, 170 ], "translation": [ 0, 1.5, -2.75 ], "scale": [ 0.375, 0.375, 0.375 ] } } }
September 22, 201510 yr To make a successful block, follow my instructions. Registry 1.) Register your block with it's unlocalized name. 2.) Register your block on the ItemModelMesher using the unlocalized name. Files 1.) You must create the model you registered for above for the block seen in the world. It's name should match the unlocalized name. 2.) Also create the model for the block's item seen in your inventory. It should also match the unlocalized name and be placed in the assets/modid/models/item package. 3.) Create your blockstate file for your block. 4.) Double check all code and texture paths both inside Java and .JSON. Development of Plugins [2012 - 2014] Development of Mods [2012 - Current]
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.