Skip to main content

Meta Action Types

Meta actions are actions that execute other actions, allowing for more complex behavior and logic. They can be used to combine multiple actions, add conditions, introduce randomness, and more.

Universal Types

info

These meta action types can be used in all types of actions.

origins:for_range

Runs an action once for every integer from 0 up to the resolved range.

FieldTypeDefaultDescription
rangeResource ReferencerequiredNumber of executions; negative values execute zero times
actionActionrequiredAction to execute

The number of executions is limited by the server general.maxActionIterations setting, which defaults to 10000 and has a maximum of 1000000.

origins:while

Runs an action while its condition remains true.

FieldTypeDefaultDescription
conditionConditionrequiredCondition tested before every execution
actionActionrequiredAction to execute

The server general.maxActionIterations setting limits executions. A loop that reaches this limit throws an error instead of continuing indefinitely.

origins:and

Executes multiple actions in sequence.

FieldTypeDefaultDescription
actionsList of ActionsrequiredActions to execute
Example1
"entity_action": {
"type": "origins:and",
"actions": [
{
"type": "origins:exhaust",
"amount": 0.5
},
{
"type": "origins:apply_effect",
"effect": {
"effect": "minecraft:regeneration",
"amplifier": 1,
"duration": 100
}
}
]
}

This example will apply exhaustion with a value of 0.5 to the player, and apply a Regeneration II status effect that would last for 5 seconds.

Example2
"entity_action": {
"type": "origins:and",
"actions": [
{
"type": "origins:execute_command",
"command": "say first"
},
{
"type": "origins:execute_command",
"command": "say second"
}
]
}

This example will execute two commands in sequence: first "say first", then "say second".

origins:chance

Random chance execution.

FieldTypeDefaultDescription
actionActionrequiredAction
chanceFloatrequiredChance (0-1)
fail_actionActionoptionalAction if chance fails
Example1
"entity_action": {
"type": "origins:chance",
"action": {
"type": "origins:set_on_fire",
"duration": 5
},
"chance": 0.4
}

This example has a 40% chance to set the entity on fire for 5 seconds.

Example2
"entity_action": {
"type": "origins:chance",
"chance": 0.5,
"action": {
"type": "origins:execute_command",
"command": "say lucky!"
},
"fail_action": {
"type": "origins:execute_command",
"command": "say unlucky..."
}
}

This example has a 50% chance of printing "lucky!" and a 50% chance of printing "unlucky...".

origins:choice

Selects from a weighted list.

FieldTypeDefaultDescription
actionsList of WeightedActionrequiredWeighted action list

For each entry in the actions list:

FieldTypeDefaultDescription
elementActionrequiredAction to execute
weightInteger1Weight for selection
Example1
"entity_action": {
"type": "origins:choice",
"actions": [
{
"element": {
"type": "origins:exhaust",
"amount": 0.5
},
"weight": 10
},
{
"element": {
"type": "origins:apply_effect",
"effect": {
"effect": "minecraft:regeneration",
"amplifier": 1,
"duration": 100
}
},
"weight": 10
},
{
"element": {
"type": "origins:set_on_fire",
"duration": 8
},
"weight": 20
}
]
}

This example has multiple entity action types with different weights: one with a 25% chance of applying exhaustion with a value of 0.5 to the player, another with a 25% chance of applying a Regeneration II status effect that would last for 5 seconds, and another one with a 50% of setting the entity on fire for 8 seconds.

Example2
"entity_action": {
"type": "origins:choice",
"actions": [
{
"action": {
"type": "origins:execute_command",
"command": "say option A"
},
"weight": 3
},
{
"action": {
"type": "origins:execute_command",
"command": "say option B"
},
"weight": 1
}
]
}

This example has a 75% chance of picking option A and 25% chance for option B.

origins:delay

Delays execution.

FieldTypeDefaultDescription
actionActionrequiredAction
ticksIntegerrequiredDelay in ticks
Example1
"entity_action": {
"type": "origins:delay",
"ticks": 20,
"action": {
"type": "origins:apply_effect",
"effect": {
"effect": "minecraft:speed",
"amplifier": 1,
"duration": 80
}
}
}

This example will apply a Speed II status effect after 1 second.

Example2
"entity_action": {
"type": "origins:delay",
"ticks": 40,
"action": {
"type": "origins:execute_command",
"command": "say 2 seconds have passed"
}
}

This example will execute the command after a 2-second (40 tick) delay.

origins:empty

Does nothing.

origins:if_else

Conditional execution.

FieldTypeDefaultDescription
conditionActionrequiredCondition
if_actionActionoptionalAction if true
else_actionActionoptionalAction if false
Example
"entity_action": {
"type": "origins:if_else",
"condition": {
"type": "origins:fall_flying"
},
"if_action": {
"type": "origins:set_on_fire",
"duration": 5
},
"else_action": {
"type": "origins:heal",
"amount": 6
}
}

This example will set the entity on fire for 5 seconds if they are "fall flying". Otherwise, it will restore 3 hearts of health to the entity instead.

origins:if_else_list

Condition-action pairs.

FieldTypeDefaultDescription
actionsList of IfElseEntryrequiredCondition-action pairs

For each entry in the actions list:

FieldTypeDefaultDescription
conditionActionrequiredCondition
actionActionrequiredAction if condition is true
Example
"entity_action": {
"type": "origins:if_else_list",
"actions": [
{
"condition": {
"type": "origins:health",
"comparison": "<=",
"compare_to": 6
},
"action": {
"type": "origins:apply_effect",
"effect": {
"effect": "minecraft:speed",
"amplifier": 2,
"duration": 80
}
}
},
{
"condition": {
"type": "origins:health",
"comparison": "<=",
"compare_to": 12
},
"action": {
"type": "origins:apply_effect",
"effect": {
"effect": "minecraft:speed",
"amplifier": 1,
"duration": 80
}
}
},
{
"condition": {
"type": "origins:health",
"comparison": "<=",
"compare_to": 18
},
"action": {
"type": "origins:apply_effect",
"effect": {
"effect": "minecraft:speed",
"amplifier": 0,
"duration": 80
}
}
}
]
}

This example will apply a stronger Speed status effect the lower the entity's health is, in three stages (<= 3 hearts, <= 6 hearts or <= 9 hearts).

origins:side

Specific side only.

FieldTypeDefaultDescription
actionActionrequiredAction
sideStringrequiredclient or server
Example1
"entity_action": {
"type": "origins:side",
"side": "client",
"action": {
"type": "origins:change_resource",
"resource": "example:resource",
"change": 1
}
}

This example will add 1 to the example:resource power on the client-side.

Example2
"entity_action": {
"type": "origins:side",
"side": "server",
"action": {
"type": "origins:execute_command",
"command": "say server only"
}
}

This action will only execute on the server side.

Bi-entity Specific

origins:invert

Swaps actor and target.

FieldTypeDefaultDescription
actionBi-entity ActionrequiredAction with swapped entities
Example
"bientity_action": {
"type": "origins:invert",
"action": {
"type": "origins:mount"
}
}

This example will mount the target entity onto the actor entity, as their roles are now swapped.

origins:source_action

Executes an entity action on the actor only.

FieldTypeDefaultDescription
actionBi-entity ActionrequiredAction on the actor
Example
"bientity_action": {
"type": "origins:actor_action",
"action": {
"type": "origins:set_on_fire",
"duration": 5
}
}

This example will set the actor entity on fire for 5 seconds.

origins:target_action

Executes an entity action on the target only.

FieldTypeDefaultDescription
actionBi-entity ActionrequiredAction on the target
Example
"bientity_action": {
"type": "origins:target_action",
"action": {
"type": "origins:set_on_fire",
"duration": 5
}
}

This example will set the target entity on fire for 5 seconds.

Block Specific

origins:absolute_offset

Executes an action at an absolute offset.

FieldTypeDefaultDescription
actionBlock ActionrequiredAction
xInteger0X offset
yInteger0Y offset
zInteger0Z offset

origins:region_apply

Applies an action to all blocks in a cubic region.

FieldTypeDefaultDescription
radiusDouble16.0Radius
shapeShapecubeHow to select blocks
block_actionBlock ActionrequiredAction to apply
block_conditionBlock ConditionoptionalCondition to filter blocks
Example
"block_action": {
"type": "origins:area_of_effect",
"radius": 16,
"shape": "cube",
"block_action": {
"type": "origins:modify_block_state",
"property": "waterlogged",
"value": false
}
}

This example will make all waterloggable blocks not waterlogged within 16 blocks radius with a shape of a cube.

origins:relative_offset

Executes an action at a relative offset based on the entity's facing.

FieldTypeDefaultDescription
actionBlock ActionrequiredAction
forwardInteger0Forward offset
rightInteger0Right offset
upInteger0Up offset
Example
"block_action": {
"type": "origins:offset",
"action": {
"type": "origins:add_block",
"block": "minecraft:gravel"
},
"y": 1
}

This example will offset the position of the Add Block in the positive Y axis, raising the positional context of the block action to be 1 block above to where it initially was.

Entity Specific

origins:region_apply

Applies an action to all entities in a cubic region.

FieldTypeDefaultDescription
radiusDouble16.0Radius
shapeShapecubeHow to select entities
bientity_actionBiEntity ActionrequiredAction to apply
bientity_conditionBiEntity ConditionoptionalCondition to filter entities
includeActorBooleanfalseWhether to include the actor entity in the selection