Skip to main content

Damage condition

Checks the damage source, damage amount and related entities. Embedded in DamageCondition fields.

Types​

saturn:amount​

Compares the damage amount with a number.

FieldTypeRequiredDefaultDescription
typeResource IDyes—saturn:amount
comparisonEnum stringyes—Comparison operator: ==, !=, <, <=, > or >=.
compare_toNumberyes—Numeric comparison target, used with comparison.
Example
{
"type": "saturn:amount",
"comparison": ">=",
"compare_to": 5
}

saturn:amount_range​

Checks whether the damage amount is between min and max, inclusive.

FieldTypeRequiredDefaultDescription
typeResource IDyes—saturn:amount_range
minNumber provideryes—Lower bound.
maxNumber provideryes—Upper bound.
Example
{
"type": "saturn:amount_range",
"min": 1,
"max": 1
}

saturn:attacker​

Checks the causing entity of the damage source; returns false when there is none.

FieldTypeRequiredDefaultDescription
typeResource IDyes—saturn:attacker
entity_conditionEntity conditionsyes—Filter condition of the declared context type.
Example
{
"type": "saturn:attacker",
"entity_condition": {
"type": "saturn:living"
}
}

saturn:damage_type​

Checks the type of the damage source.

FieldTypeRequiredDefaultDescription
typeResource IDyes—saturn:damage_type
damage_typeResource IDyes—A vanilla damage type ID.
Example
{
"type": "saturn:damage_type",
"damage_type": "minecraft:generic"
}

saturn:damage_type_tag​

Checks whether the damage type belongs to the given tag.

FieldTypeRequiredDefaultDescription
typeResource IDyes—saturn:damage_type_tag
tagTag ID (without #)yes—A registry tag, or the NBT data declared by this page.
Example
{
"type": "saturn:damage_type_tag",
"tag": "example:tag"
}

saturn:directness​

Checks whether the damage is direct damage.

FieldTypeRequiredDefaultDescription
typeResource IDyes—saturn:directness
directBooleannotruetrue requires direct damage, false requires indirect damage.
Example
{
"type": "saturn:directness"
}

saturn:fire​

Checks whether the damage source is fire damage.

FieldTypeRequiredDefaultDescription
typeResource IDyes—saturn:fire
Example
{
"type": "saturn:fire"
}

saturn:magic​

Checks whether the damage source is magic damage.

FieldTypeRequiredDefaultDescription
typeResource IDyes—saturn:magic
Example
{
"type": "saturn:magic"
}

saturn:projectile​

Checks whether the damage comes from a projectile matching the type or condition.

FieldTypeRequiredDefaultDescription
typeResource IDyes—saturn:projectile
projectileResource IDnoomittedProjectile entity type ID.
projectile_conditionEntity conditionno{"type":"saturn:always"}Condition applied to the projectile entity.
Example
{
"type": "saturn:projectile"
}

Meta types​

These types do not test a concrete value themselves; they combine or delegate other types of the same kind and are embedded in the same fields.

saturn:always​

The condition is always true.

FieldTypeRequiredDefaultDescription
typeResource IDyes—saturn:always
Example
{
"type": "saturn:always"
}

saturn:and​

Matches only when every sub-condition holds.

FieldTypeRequiredDefaultDescription
typeResource IDyes—saturn:and
conditionsArray of conditions of the same kindyes—List of sub-conditions of the same kind.
Example
{
"type": "saturn:and",
"conditions": []
}

saturn:chance​

Decides whether the check succeeds based on a given chance.

FieldTypeRequiredDefaultDescription
typeResource IDyes—saturn:chance
chanceNumberyes—Hit chance; 0 never matches, 1 always matches. Codec range: 0.0D, 1.0D.
Example
{
"type": "saturn:chance",
"chance": 1
}

saturn:constant​

Returns the configured boolean value.

FieldTypeRequiredDefaultDescription
typeResource IDyes—saturn:constant
valueBooleanyes—The boolean result, or the expected/new boolean block property value.
Example
{
"type": "saturn:constant",
"value": true
}

saturn:js​

Calls a callback registered by KubeJS and passes the params argument.

FieldTypeRequiredDefaultDescription
typeResource IDyes—saturn:js
idStringyes—Identifier of the callback, option or entry.
paramsObjectno{}Parameter object passed to the script or formula.

Registered only when KubeJS is installed. JSON only selects an existing callback; it never executes a JavaScript string inside the JSON directly.

Example
{
"type": "saturn:js",
"id": "example_callback",
"params": {}
}

saturn:never​

The condition is always false.

FieldTypeRequiredDefaultDescription
typeResource IDyes—saturn:never
Example
{
"type": "saturn:never"
}

saturn:not​

Inverts the match result of the sub-condition.

FieldTypeRequiredDefaultDescription
typeResource IDyes—saturn:not
conditionDamage conditionyes—The condition to check.
Example
{
"type": "saturn:not",
"condition": {
"type": "saturn:always"
}
}

saturn:or​

Matches when any sub-condition holds.

FieldTypeRequiredDefaultDescription
typeResource IDyes—saturn:or
conditionsArray of conditions of the same kindyes—List of sub-conditions of the same kind.
Example
{
"type": "saturn:or",
"conditions": []
}