Skip to main content

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

Health

The arc:health condition type checks the player's current health.

Parameters

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

Example

The following example gives resistance when the player falls below 30% health.

data/my_datapack/arc/low_health_resist.json
{
"holder": {
"type": "arc:player",
"id": "arc:player"
},
"type": "arc:on_get_hurt",
"conditions": [
{
"type": "arc:health",
"health": 30,
"comparison": "<",
"is_percentage": true
}
],
"rewards": [
{
"type": "arc:effect",
"effect": {
"id": "minecraft:resistance",
"duration": 200,
"amplifier": 1
}
}
]
}

Compatible Action Types