How to do procedures for entity health?

Started by CaiGuyCrafter on

Topic category: Help with Minecraft modding (Java Edition)

Joined Dec 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to do procedures for entity health?

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.

Joined Jun 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
There is a block in the…
Sun, 07/04/2021 - 06:03

There is a block in the entity data section called "Max health of"[Entity to get max health of]. 

Joined Jun 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
To set the clones health, I…
Sun, 07/04/2021 - 06:05

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.

Joined Dec 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yeah, I use it, I just didn…
Sun, 07/04/2021 - 20:07

Yeah, I use it, I just didn't know how to get the max health of the entity, thanks.