| Name | Hurt |
| Syntax | hurt (<#.#>) ({player}/<entity>|...) (cause:<cause>) (source:<entity>/<location>) |
| Short Description | Hurts the player or a list of entities. |
| Full Description | Does damage to a list of entities, or to any single entity.
If no entities are specified: if there is a linked player, the command targets that. If there is no linked player but there is a linked NPC, the command targets the NPC. If neither is available, the command will error. Does a specified amount of damage usually, but, if no damage is specified, does precisely 1HP worth of damage (half a heart). Optionally, specify (source:<entity>) to make the system treat that entity as the attacker. If using a block-type cause such as "contact", you *must* specify (source:<location>) to set that block location as the attacker. The block can be any block, even just "<player.location>" (as long as the player in inside a world). You may also specify a damage cause to fire a proper damage event with the given cause, only doing the damage if the event wasn't cancelled. Calculates the 'final damage' rather than using the raw damage input number. See damage cause for damage causes. Using a valid 'cause' value is best when trying to replicate natural damage, excluding it is best when trying to force the raw damage through. Note that using invalid or impossible causes may lead to bugs |
| Related Tags | <EntityTag.health> Returns the current health of the entity.
<EntityTag.last_damage.amount> Returns the amount of the last damage taken by the entity.
<EntityTag.last_damage.cause> Returns the cause of the last damage taken by the entity.
<EntityTag.last_damage.duration> Returns the duration of the last damage taken by the entity.
<EntityTag.last_damage.max_duration> Returns the maximum duration of the last damage taken by the entity.
|
| Usage Example | |
| Usage Example | |
| Usage Example | |
| Synonyms (Search Aid) | damage, injure |
| Group | entity |
| Source | https://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/HurtCommand.java#L31 |