Skip to main content

Get 25% OFF on your first order with BisectHosting using code "DAQEM"!

Target Health

The arc:target_health condition type checks the health of the target entity involved in the action.

Parameters

ParameterTypeRequiredDefaultDescription
healthdoubleRequired-The health value.
comparisonComparisonTypeOptional==Comparison type.
is_percentagebooleanOptionalfalseIs the value a percentage.

Example

The following example executes a command when hitting an entity with less than 50% health.

data/my_datapack/arc/execute_low_health.json
{
"holder": {
"type": "arc:player",
"id": "arc:player"
},
"type": "arc:on_hurt_entity",
"conditions": [
{
"type": "arc:target_health",
"health": 50,
"comparison": "<",
"is_percentage": true
}
],
"rewards": [
{
"type": "arc:command",
"command": "say Finish him!"
}
]
}

Compatible Action Types