Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

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.

  • 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

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

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.

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.

  • 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

  • 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 ]

    }

  }

}

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.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.