#[Solved?] How can i change an entity texture depending on the entity health
1 messages · Page 1 of 1 (latest)
Never found anyone ask for it.
So why dont I...
Eh wait a min.. Should i put it at #1067869022273667152?
@lament isle you have to use query.health in the render controller
{
"format_version": "1.8.0",
"render_controllers": {
"controller.render.iron_golem_cracks": {
"arrays": {
"textures": {
"Array.cracks": [
"Texture.cracked_high",
"Texture.cracked_med",
"Texture.cracked_low",
"Texture.cracked_none"
]
}
},
"geometry": "Geometry.default",
"textures": [ "Array.cracks[math.clamp(query.health / 25, 0, 3)]" ]
}
}
}```
How does this work? Can u like explain a lil bit to me..
(im domb)
What part?
The math.clamp
So iron golem has a health value of 100
mhm
The number of textures that you're going to be using
The array helps with adding those 4 textures
So it gonna use texture.cracked_none?
Yeah so that's the regular iron golem texture
Oh ok
What about the 0 and 3?
hm..
Oooh so its 0 first
math.clamp(value, min, max) = Clamp value to between min and max inclusive
mhm
yes, but the formula makes it start at 3, because 100/25 = 4th texture
and as the health goes down, the 3 goes to 2 then 1 and 0 below or at a health value of 25
ohh oke ok
good to go?
[Solved?] How can i change an entity texture depending on the entity health
@lament isle let me know if you have questions
One last question*maybe
How can I apply this to mob that have variant as example shulker
*its dyable
Let me see your custom mob entity file
Also send me a picture of your mob
We may need to create a custom material for this
Its the shulker entity file
Im making some improvements pack(kinda)
Hmm I think it would be a bit tricky with the shulker because it has several textures, you may need to add an overlay texture to optimize it
How can I achieve that?
Can you show me the shulker entity file