#Dynamic model layers
1 messages · Page 1 of 1 (latest)
I have this texture, which can have the quill toggled on and off, as well as have a varying amount of paper filled in it, ranging from none to as much as can fit in a 16x16 texture(5 textures in total)
That would require 10 separate models to do this, when I would think I can specify overrides that allow me to just say "if predicate quill = 1 then add quill layer"
No way in vanilla afaik. Optifine cit can swap texture based on condition, but I don't think it works on cit model.
Rip
So I have to do multiple overrides for each?
How would I order that? Currently I'm doing this
{
"parent": "item/generated",
"textures": {
"layer0": "jubilant:items/dave/zero"
},
"overrides": [
{
"predicate": {
"damage": 0
},
"model": "jubilant:item/dave/four"
},
{
"predicate": {
"damage": 0.25
},
"model": "jubilant:item/dave/three"
},
{
"predicate": {
"damage": 0.5
},
"model": "jubilant:item/dave/two"
},
{
"predicate": {
"damage": 0.75
},
"model": "jubilant:item/dave/one"
},
{
"predicate": {
"damage": 1
},
"model": "jubilant:item/dave/zero"
}
]
}
Where would I add "quill": 1 in to make this work
Because I don't fully understand how the order of these work
Any reason why you are using damage predicate?
I want the durability bar
Because as you use the book it runs out of paper
And yes, the book is called dave lol
Vanilla has no quill predicate, so either you have a system that detect the amount if quill then apply different damage.
I'm using mods so I can add new predicates
I'm just asking like, how do I order each of the override blocks to make this work
I made a zeroQuill, oneQuill, etc. variant of each, so where would I put that if quill = 1
!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!
Just a example, you see that one predicate have both custom model data and blocking
Ah, ok
So I would put each quill variant after the non-quill one?
{
"predicate": {
"damage": 0
},
"model": "jubilant:item/dave/four"
},
{
"predicate": {
"damage": 0,
"quill": 1
},
"model": "jubilant:item/dave/fourQuill"
},
Yes. Values always order from low to high. And checking is less to more.
Does spamming the json with overrides cause any performance issues?
I recalled someone talked about it, but that's like around 1000.
@-@