Is there any way to add/remove health after an entity has been created? For example, I'd like to have a X mob regenerate Y "hearts" when Z happens. Thanks for any help in advance.
There are two ways. Using MCP obfuscation mappings, the first and proper way to do so is with:
You need to specify where the damage came from in the first parameter though, so the simpler one is to simply use:
Use this with getHealth so you can do stuff like entity.setEntityHealth(entity.getHealth() - 1);