Skip to main content

Hurt Entity

The arc:on_hurt_entity action type is triggered when a player hurts an entity.

Action Data

When this action is triggered, the following action data is made available to be used by conditions and rewards:

Action Data TypeDescription
arc:entityRepresents an entity in the game, such as a player, mob, or item.
arc:damage_sourceIdentifies the source of damage, such as an entity, environment, or effect.
arc:damage_amountQuantifies the amount of damage dealt or received in an action.

Example

The following example will give the player a diamond every time they hurt a zombie.

data/my_datapack/arc/diamond_for_hurting_zombie.json
{
"holder": {
"type": "arc:player",
"id": "arc:player"
},
"type": "arc:on_hurt_entity",
"conditions": [
{
"type": "arc:entity_type",
"entity_type": "minecraft:zombie"
}
],
"rewards": [
{
"type": "arc:item",
"item": {
"id": "minecraft:diamond"
}
}
]
}

Compatible Condition Types

The following condition types can be used with this action type:

Compatible Reward Types

The following reward types can be used with this action type: