Started by
Doo89
on
Topic category: User side tutorials
For versions 1.16.5 / 1.15.2 see this post: https://mcreator.net/forum/79178/tutorial-creating-texture-variations-entities-custom-code-11651152
- First, realize your elements: Entity
In my example the textures are named: chat1.png, chat2.png, chat3.png and chat4.png
- Clic on Edit code :
- Select the file that ends with: Entity.java (1 blue in my exemple)
- At the beginning of the class add this:
public int texture;
- Look for code that looks like this:
- Under the red line add:
texture =(int) Math.round((Math.random()) * 2);
That's it for this file, it should look like this:
Since I have 4 textures, the 2 should be replaced by a 3.
- Close and save, and lock the code
- Edit the code of your entity file, which ends with Renderer.java (2 red)
- Insert this line below the start of class, and modify between the parentheses
public final ResourceLocation texture = new ResourceLocation("VOTREMOD", "textures/TEXTURE.png");
- Modify the line where there is the texture (in blue)
Sorry for my English.
French video : https://www.youtube.com/watch?v=HTeQoFClJaQ
Edited by Doo89 on Wed, 02/16/2022 - 07:19
Nice tutorial :)
You don't save it inside the entity, so other players will see another texture.
Damn, thanks for the info.
I'm only testing on my PC solo, I didn't even think other players could see another texture.
But if I see a red cat and another player sees it green, does it matter?
how do I do this with geckolib mobs