#Textures from original item dissapears
20 messages · Page 1 of 1 (latest)
Welcome to the help forum! Once your question has been resolved, please mark the post as closed by typing !close.
(Result for "custom_model_data")
Disclaimer: This only works for items (not placed blocks!) and only if you are in Java Edition 1.14 or later!
Example to give a stick 4 new models:
You'd place this file in YourResourcePack/assets/minecraft/models/item and call it stick.json.
stick.json
{
"parent": "item/generated",
"textures": {
"layer0": "item/stick"
},
"overrides": [
{ "predicate": {"custom_model_data": 1}, "model": "item/custom_stick"},
{ "predicate": {"custom_model_data": 2}, "model": "custom/branch"},
{ "predicate": {"custom_model_data": 3}, "model": "block/stone"},
{ "predicate": {"custom_model_data": 4}, "model": "item/more_sticks"}
]
}```
Ingame you can give yourself one of the custom sticks by doing `/give <player> stick{CustomModelData:X}` (X being replaced by the number you want)
*PS: The model path is **always** relative to the models folder of your pack.*
*So `"item/custom_stick"` will load the model in `YourPack/assets/minecraft/models/item` called custom_stick.json.*
*For `"custom/branch"` it would be the model in `YourPack/assets/minecraft/models/custom` called branch.json and so on.*
no i mean like lets say i made a custom stick model, the normal sticks that you then can craft and dont have any custom model data are all purple black cubes.
Well, that's because you don't want to override the base stick model and just add the overrides section to it.
Just like in the example above.
alright i tried it out and it works on normal textures however it does not work with a shield, anyway to fix that?
open the shield.json in a copy of the default pack
everything that is in there needs to be in your shield.json too (if the normal shield is supposed to look like a normal shield)
where should i place it with the shield.json (my resourcepack) code? Like below or above it?
order shouldn't matter as long as it's valid .json
but the two overrides needs to be one if you meant that
!faq shield-model
This is an example of an overrides section of the shield.json to add more shields for the Java Edition.
If you don't know how/where to add this to your shield.json file, copy the one from the default pack (check !faq default pack if you don't know how to get the files) and replace the overrides section in there with this:
"overrides": [
{ "predicate": {"blocking": 1 }, "model": "item/shield_blocking" },
{ "predicate": {"custom_model_data": 1}, "model": "custom/spiky_shield" },
{ "predicate": {"custom_model_data": 1, "blocking": 1 }, "model": "custom/spiky_shield_blocking" }
]```
**Explanation of the predicates:**
_blocking_ = player is blocking with the shield (either 0 or 1)
Keep in mind that the order of predicates matters. It will always use the model of the last predicate in the list whose condiitons are all met!
kinda like that
it works now when i block however it does not work when you hold it regularly (the normal shield)
Can you show your current shield.json?
Well, cause that's missing all the info of the default shield.json (besides the overrides stuff)
You are currently telling it to inherit information it doesn't have from itself and swap to itself (model wise) when it doesn't have CustomModelData
Both of which do absolutely nothing
(Visually)