Name | Health |
Syntax | health ({npc}/<entity>|...) [<#>] (state:{true}/false/toggle) (heal) |
Short Description | Changes the target's maximum health. |
Full Description | Use this command to modify an entity's maximum health.
If the target is an NPC, you can use the 'state' argument to enable, disable, or toggle the Health trait (which is used to track the NPC's health, and handle actions such as 'on death'). The Health trait will be enabled by default. By default, this command will target the linked NPC but can be set to target any other living entity, such as a player or mob. Optionally specify the 'heal' argument to automatically heal the entity to the new health value. If not specified, the entity's health will remain wherever it was (so for example a change from 20 max to 50 max will leave an entity with 20 health out of 50 max). Additionally, you may input a list of entities, each one will calculate the effects explained above. |
Related Tags | <EntityTag.health> Returns the current health of the entity.
<EntityTag.health_max> Returns the maximum health of the entity.
<NPCTag.has_trait[health]> Returns whether the NPC has a specified trait.
|
Usage Example |
|
Usage Example |
|
Usage Example |
|
Usage Example |
|
Group | entity |
Source | https://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/HealthCommand.java#L26 |