Lucas Baizer
Lucas Baizer

Reputation: 325

MC Forge 1.8 Texturing Items

I read the question titled "Minecraft Forge 1.8 - Loading Block Textures", but the links giving in that question longer exist (error 404). So, I was curious, how do I load an item's texture in Minecraft Forge 1.8?

Upvotes: 1

Views: 850

Answers (1)

aaronedmistone
aaronedmistone

Reputation: 999

Modding for 1.8 can be a little tricky as there is sometimes too little information out there. But don't give up.

The Blocks & Items all have a linked *.json model file, this contains the UV and texture information (e.g. the texture location). Other than that, you only need to register the item/block and call your:

GetMC.getRenderItem().getItemModelMesher().register(Item, int, modelResourceLocation);

// Important notes for Items
// If you are not comfortable modelling a new item,
// just copy the model information from another simple item, like the apple.

// texture location should be "{MOD_ID}:textures/items/itemname" (Items)
// texture location should be "{MOD_ID}:textures/blocks/blockname" (Blocks)

// If you would like to make your own models with little 3D experience, I
// recommend BDCraft Cubik Pro for the **items** and **blocks**

As for Entities, they follow a slightly different format. (AFAIK) You need to have a Render file and a Model file (e.g. RenderCar.java, ModelCar.java). The Render class file should contain the render information and extend the Render class. The Model file is the 3D Model information of the entity.

Of course this information is particular to the RENDERING of the items, blocks and entities. They still need to be registered, modeled and textured correctly.

// Important note
// If you have want to try modeling your own entities, I would recommend
// looking into Techne for that, it creates the .java files with less work

Examples of the above:

// .json model file
{
    "__comment": "this is just a tiny piece of the model ",
    "textures": {
    "particle": "mm:items/browning9mm",
    "texture": "mm:items/browning9mm"
},
"elements": [ 
{
    "__comment": "browning9mmshape x128",
    "from": [ 0.875, 11, 7 ],
    "to": [ 13.875, 13, 9 ],
    "faces": {
        "down":  { "uv": [ 0.875, 5, 13.875, 4.5 ], "texture": "#texture" },
        "up":    { "uv": [ 0.875, 3, 13.875, 3.5 ], "texture": "#texture" },
        "north": { "uv": [ 13.875, 3, 0.875, 5 ], "texture": "#texture" },
        "south": { "uv": [ 0.875, 3, 13.875, 5 ], "texture": "#texture" },
        "west":  { "uv": [ 1.3125, 10.4375, 2.875, 13.625 ], "texture": "#texture" },
        "east":  { "uv": [ 3.8125, 7.0625, 5.5, 10.3125 ], "texture": "#texture"
       }
    }
}

Upvotes: 3

Related Questions