Skip to content
Contractsv1.9.0

Player Health

⭐ Premium

Progress counts only when the health of the player performing the action is within the specified bounds at that instant.

{
"type": "PlayerHealth",
"maxHealth": 25
}
FieldTypeDescription
typestringExactly 'PlayerHealth'
minHealthnumber | null (≥ 0)Minimum player HP (raw HP, NOT a fraction). Null (or omitted) means no lower bound.
maxHealthnumber | null (≥ 0)Maximum player HP (raw HP, NOT a fraction). Null (or omitted) means no upper bound.
  • Bounds are raw HP, not a percentage: 50 means 50 health points, not 50%. A full-health player is at 100 unless something raised their max health.
  • Either bound can be null (or omitted entirely) for “no limit on that side”, but at least one bound is required. A condition with neither bound would always be satisfied, so it is invalid and the contract will not load.
  • Set only maxHealth for a “while wounded” rule, or only minHealth for a “while healthy” rule.
  • If minHealth is greater than maxHealth, the plugin swaps them and logs a warning.
  • Configs from before 1.8.0 used -1 to disable a bound. The plugin still reads a negative bound as “no bound”, and importing an old file into the editor rewrites it to null automatically.

Kill 5 players while below 25 HP:

{
"type": "Kill",
"amountRequired": 5,
"entities": ["player"],
"conditions": {
"wounded": {
"type": "PlayerHealth",
"maxHealth": 25
}
}
}