Topic category: Help with Minecraft modding (Java Edition)
So, I'm making a clone of the player. I don't know how to copy the player's skin onto the clone, so I've just been using a Steve skin. But that's a topic for later. What I need to know is, how would I do a procedure where it gets the player's health, and divides it in half so that the clone entity is a weaker version of the player. Don't get me wrong, I have variables set up that already detect how much health the player has, and I tested them and they worked, I just need to know how to make the entity get the player's health and divide it for it's own health. I'm assuming this would mean going into the source code and writing lines above or below where the health is listed for the entity? I'm fine with that, as long as you tell me exactly where and how to do it. If you can, thanks so much, this would be great. In my mod, player's can upgrade their health and to have the clone gradually become stronger too is perfect.
There is a block in the entity data section called "Max health of"[Entity to get max health of].
To set the clones health, I would recommend an MCreator plugin called "DTM's Toolkit". There is a block in it that lets you set max health of entities. Either this or custom code. Using the plugin is a lot easier.
Yeah, I use it, I just didn't know how to get the max health of the entity, thanks.