Skip to main content

Bi-entity condition

Checks the relationship between the actor and the target. Swapping the two sides changes the meaning of some conditions.

Types​

saturn:attack_target​

Checks whether target is the mob actor’s current attack target.

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

actor is the initiator and target the other entity; their order is defined by the caller.

saturn:attacker​

Checks whether actor is the last living attacker of target.

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

actor is the initiator and target the other entity; their order is defined by the caller.

saturn:can_see​

Checks the line of sight between the two sides with a block and fluid ray.

FieldTypeRequiredDefaultDescription
typeResource IDyes—saturn:can_see
shape_typeObjectno"visual"Block shape mode used by the line-of-sight ray. Available values: collider, outline, visual, falldamage_resetting.
fluid_handlingObjectno"none"How the line-of-sight ray handles fluids. Available values: none, source_only, any, water.
Example
{
"type": "saturn:can_see"
}

saturn:distance​

Checks whether the distance between the actor and the target is within the maximum.

FieldTypeRequiredDefaultDescription
typeResource IDyes—saturn:distance
maximumNumber provideryes—The maximum value, or upper bound.
Example
{
"type": "saturn:distance",
"maximum": 1
}

saturn:equal​

Checks whether actor and target are the same entity instance.

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

actor is the initiator and target the other entity; their order is defined by the caller.

saturn:owner​

Checks whether actor’s UUID matches the owner reference of target.

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

actor is the initiator and target the other entity; their order is defined by the caller.

saturn:relation​

Checks whether the actor and the target are allied to each other.

FieldTypeRequiredDefaultDescription
typeResource IDyes—saturn:relation
alliedBooleannotrueExpected alliance state.
Example
{
"type": "saturn:relation"
}

saturn:relative_rotation​

Compares the rotation difference between the actor and the target on the given axes.

FieldTypeRequiredDefaultDescription
typeResource IDyes—saturn:relative_rotation
axisArray of enum stringsno["x","y","z"]Rotation axes included in the calculation. Available values: x, y, z.
actor_rotationEnum stringno"head"Whether the actor uses head or body rotation. Available values: head, body.
target_rotationEnum stringno"body"Whether the target uses head or body rotation. Available values: head, body.
comparisonEnum stringyes—One of ==, !=, <, <=, >, >=.
compare_toNumberyes—The target number to compare against.
Example
{
"type": "saturn:relative_rotation",
"comparison": ">=",
"compare_to": 1
}

saturn:riding​

Checks whether actor is directly riding target.

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

actor is the initiator and target the other entity; their order is defined by the caller.

saturn:riding_recursive​

Checks multi-level riding relationships.

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

saturn:riding_root​

Checks whether target is actor’s root vehicle.

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

actor is the initiator and target the other entity; their order is defined by the caller.

An unmounted entity is its own root vehicle, so the same entity passed at both ends can also match.

saturn:same_team​

Checks whether the actor and the target are on the same team.

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

saturn:team​

Reads or checks the scoreboard team of the entity.

FieldTypeRequiredDefaultDescription
typeResource IDyes—saturn:team
same_teamBooleannotruetrue requires the same team, false requires different teams.
Example
{
"type": "saturn:team"
}

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:actor_condition​

Lets the actor be checked by an entity condition.

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

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:both​

Checks the same entity condition against both the actor and the target; matches only when both hold.

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

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
}

actor is the initiator and target the other entity; their order is defined by the caller.

saturn:either​

Checks the same entity condition against the actor and the target; matches when at least one side holds.

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

saturn:invert​

Swaps actor and target before evaluating the nested object.

FieldTypeRequiredDefaultDescription
typeResource IDyes—saturn:invert
conditionBi-entity conditionsyes—Filter condition of the declared context type.
Example
{
"type": "saturn:invert",
"condition": {
"type": "saturn:always"
}
}

actor is the initiator and target the other entity; their order is defined by the caller.

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:mutual​

Requires the bi-entity condition to hold both in the original order and with the actor and target swapped.

FieldTypeRequiredDefaultDescription
typeResource IDyes—saturn:mutual
conditionBi-entity conditionyes—The condition to check.
Example
{
"type": "saturn:mutual",
"condition": {
"type": "saturn:always"
}
}

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
conditionBi-entity 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": []
}

saturn:target_condition​

Lets the target be checked by an entity condition.

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

saturn:undirected​

Matches if the original order or the swapped actor and target order matches once.

FieldTypeRequiredDefaultDescription
typeResource IDyes—saturn:undirected
conditionBi-entity conditionyes—The condition to check.
Example
{
"type": "saturn:undirected",
"condition": {
"type": "saturn:always"
}
}