Minecraft Commands – How to Make Mobs Change Textures Based on Custom Name

minecraft-commandsminecraft-java-edition

I have been trying for the past day to figure out how to make it so that when a vindicator is named "Enchanter", it switches its textures.

None of the tutorials I have watched work. I've done everything I can think of and I am out of options now, I even searched to see if this question has been asked before, and I either cant find it, or it simply does not work.

This is in java 1.16.5 with a custom resource pack.

Best Answer

This is not possible with vanilla, though OptiFine has it as a feature. Here's a documentation of it.

The custom texture for the mob must be named vindicator<num>.png inside the assets\minecraft\optifine\random\entity\illager folder, where <num> is a number (starts at 1.)

Inside the same folder, you'll also need a .properties file with the same name as the vanilla texture (meaning it would be vindicator.properties.) Here's how its contents would look like:

name.<num>=Enchanter
  • <num> being the same number as the custom texture has in its name.

This should now display the custom texture to the vindicator with the name "Enchanter"