Jump to content

[1.8]Blocks item model not working?


Looke81

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 6 months later...

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 ]

    }

  }

}

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.