Hey, does anyone know how to make bedrock have a probability of texture in mobs for txt packs?
I wanted to add that probability system to my duck texture, if anyone could help me I would appreciate it
I wanted to add that probability system to my duck texture, if anyone could help me I would appreciate it
Create an account or sign in to comment.
3
2
1. in the entity file for your duck you want to have a section under the scripts area that is called initialize (check other entity files for reference).
2. add a new variable to it like "variable.variant = math.random_integer(low, high)" you'll want to make the low end 0 and the high end how many textures you have -1 (so count up from 0, if you have 5 textures you would make the high end 4)
3. in the render controller for your duck add a new array and call it "textures" (again see other render controllers for reference). add all of your textures into that array.
4. under the "textures" object in the render controller outside of the array cahnge it from texture.default to "array.textures[variable.variant]"
that should be all there is to it. you could also check my cod to koi texture pack it has the same principle tho it might have a few more steps.
Hope this helps!
2. add a new variable to it like "variable.variant = math.random_integer(low, high)" you'll want to make the low end 0 and the high end how many textures you have -1 (so count up from 0, if you have 5 textures you would make the high end 4)
3. in the render controller for your duck add a new array and call it "textures" (again see other render controllers for reference). add all of your textures into that array.
4. under the "textures" object in the render controller outside of the array cahnge it from texture.default to "array.textures[variable.variant]"
that should be all there is to it. you could also check my cod to koi texture pack it has the same principle tho it might have a few more steps.
Hope this helps!
2
also to add more probability to specific textures just add the same texture to the array multiple times to increase it's probability to show up and increase the high end to the variant variable to match the amount of items you have in the array.
1
I'll see if I can do it, thank you very much dude!:]