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.
Tell me more
×
Game Development Stack Exchange is a question and answer site for
professional and independent game developers. It's 100% free, no registration required.
|
|
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); |
|||
|
|
