Jump to content

How does de new item & block textures works?


Kander16

Recommended Posts

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!

Link to comment
Share on other sites

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

 

 

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.