#conditionally render item based on their components

21 messages · Page 1 of 1 (latest)

civic meteor
#

e.g if I have an item with a custom component on it, say is_frozen (boolean)

how do I render the item with texture a.png when the component turns false
and render with texture b.png when the component turns true

high nexus
#

use item model predicates which would be the easiest solution

civic meteor
#

and the predicate only accepts floats

#

I have tried passing boolean, but it only support floats (the log says)

high nexus
#

represent the boolean using a float

#

1, 0

#

the wiki example does that

civic meteor
civic meteor
high nexus
#

do you have a finite number of texts?

civic meteor
#

yes

#

infinite is impossible tho

high nexus
#

then represent them as floats too

civic meteor
#

yes you provide arbitrary text

#

but don't worry, instead of texts, I'll just use integers

high nexus
#

there's also custom_model_data