Topic category: Advanced modding
I'm coming back to MCreator after like 2 years.
I'm trying to make a mob that has texture variants.
The mob has an NBT tag assigned at spawn, which determines the correct variant.
The problem is, in MCreator, there is no way to change the entity's texture directly.
So after some digging, I found that I can edit the renderer file for the mob, and edit 'getTextureLocation()' to change the textures.
The problem is, I need a reference to the entity so that I can get the NBT tag, however, I don't know how.
I've tried LivingEntityRenderState.entity, and LivingEntityRenderState.GetEntity()
But those did not work.
And I see that 'entity' is already defined at the top of the file, but its being directly set to NULL.
So I don't know where to go from here.
The new model layers feature does allow you to completely change an entity's texture entirely inside MCreator's interface without needing to go into the code at all.
All you need to do is create a model layer with a different texture, then set the condition for the model layer to be a procedure that is simply 'return logic: get entity custom number nbt tag (tag) = (number)'
You would need to create a different procedure for each different nbt tag value, but it shouldn't be hard at all using the new MCreator features.
Welcome back!
There is no need for any code, you can change entity model layers that have different textures with simple procedure conditions.
Also don't use NBT as Catnip suggested, but rather use synced entity data