Posted January 10, 201510 yr 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.
January 12, 201510 yr 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!
January 12, 201510 yr 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
January 13, 201510 yr do you actually need to register it like that? i get the same messages in my log regardless. i thought that was just in the really early 1.8 builds http://www.planetminecraft.com/member/sigurd4 I'm making the bioshock mod!
January 13, 201510 yr 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.