Started by
The1GiantWalrus
on
Topic category: Help with Minecraft modding (Java Edition)
I want to make a mob that disguises itself as a player. I've got its AI pretty much done, but I want it to copy the skin of the player. How would I go about doing this? (A tutorial would be appreciated)
it can be done but requires you to edit code of your entity (around 30+ lines of code to manually add)
Can you post an example of how to do this, Ahznb?
Just Go To Blockbench Then Click the Minecraft Skin Button Choose The Mob You Want
You Can Add Some Parts To It And Change The Texture Because It Does Not Have Any Color
When You Are Done Click On File And Click Convert Project
Convert It To A Modded Entity
Click On File Again Hover On Export And Export it As A Java Entity
Then Save The File
Go To The MCreator Workspace
Click On Import Java 3D Model
Go To Your Mod Element And Change The Entity Model To Your Imported Java Entity
Add Your Texture
And There Done
first, add an AI goal to your entity "watch closest entity in radius [x] of type [EntityPlayer]", no conditions. save and build.
next, edit the code of your mod entity. this will open the source code editor.
you will need to create a server to client sync data field in your entity class. find your entity's class and add a data sync field to send player id data from server to client, register the data field, and create methods to get/set the data. then override the new added AI goal to set the player id to the player this entity is looking at:
next you will need to modify the custom renderer for so that it will check if a player id is set. if so, change the texture to the player's texture. Note: you will also need to do some other modifications like changing the texture size of the model to 64x64 and the change the model scale, since player textures are 64x64. here's an example:
Note: make sure you change your entity's model texture to 64x64 as well. mcreator defaults to using the 64x32 biped model.
now see if it works!
made a mistake. change one line:
to:
This is so great! I need all of this, but I have a question, where do I find all of this code?
To clarify more, where would I go to find this in the code? Would I just create a "custom element" with Mcreator or do I have to go in some source files or something specific?
I know im using this in my mod
. . . what? how when what code how add and what
yeah im trying to get this to work but am so confused
so if someone could help me that would be great my discord is pancakes3
I also would like clarification on this, It wasn't explained too well...
Ahznb Can you send one where a tamed entity turns into the players texture?