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

Hi,

 

I was trying to update my mod to version 1.8, but I got a problem with the setTexture name.

I have been looking for it in the Item.class file, Is it now with the setUnlocalizedName to?

 

Thanks.

Creator of the Master Chef Mod and many more to come.

 

If I helped you, please click the 'thank you' button.

i can't get it to work either, but from what i understand, for items you need a model file with the name of the string item id like this:

(<modid> is the mod id of your mod, <itemid> is the string item id of your item, same with <blockid> but for your block, <texture> is the name of your texture file without ".png", <model> is the string entered into the blockstate file)

/src/main/resources/assets/<modid>/models/item/<itemid>.json:

{
    "parent": "builtin/generated",
    "textures": {
        "layer0": "<modid>:items/<texture>"
    },
    "display": {
        "thirdperson": {
            "rotation": [ -90, 0, 0 ],
            "translation": [ 0, 1, -3 ],
            "scale": [ 0.55, 0.55, 0.55 ]
        },
        "firstperson": {
            "rotation": [ 0, -135, 25 ],
            "translation": [ 0, 4, 2 ],
            "scale": [ 1.7, 1.7, 1.7 ]
        }
    }
}

and for blocks you need both a blockstate file which has the name of the string block id and a model file.

/src/main/resources/assets/<modid>/blockstates/<blockid>.json:

{
    "variants": {
        "normal": [
            { "model": "<model>" },
            { "model": "<model>", "y": 90 },
            { "model": "<model>", "y": 180 },
            { "model": "<model>", "y": 270 }
        ]
    }
}

/src/main/resources/assets/<modid>/models/block/<model>.json:

{
    "parent": "block/cube_all",
    "textures": {
        "all": "blocks/<texture>"
    }
}

hope this helped. it's not working for me for some reason, but it might do for you. this is the way i've seen most other people do it. also the unlocalizedName doesnt affect the texture, the id does

http://www.planetminecraft.com/member/sigurd4

I'm making the bioshock mod!

Hi

 

There is a fair bit of information about item and block rendering here;

http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html

see the sections under Blocks and under Items.

 

There is also a working example project here - see example MBE01

https://github.com/TheGreyGhost/MinecraftByExample/tree/master

 

Sigurd is right, there is no such thing as setTexture anymore.

 

What sigurd has below is right except for a minor detail

block model should be in /blockstates/<blockid>.json and should have

 

You also need to register the block and (at the moment)  manually register the item model with the mesher 

Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(itemBlockSimple, DEFAULT_ITEM_SUBTYPE, itemModelResourceLocation);

 

-TGG

 

 

Hi

 

You could be right, I haven't tried it in the last couple of weeks.  I'll give it a go.

 

Edit: I just tried it, you still need it.  You get a missing texture otherwise (no error in the console but the model renders as the missing model cube).

 

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

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.