Active Self
Executes an Entity Action Type on the entity that has the power upon pressing the specified Key.
Type ID: origins:active_self
Fields
Field | Type | Default | Description |
---|---|---|---|
entity_action |
Entity Action Type | The action to execute on the player. | |
cooldown |
Integer | 1 |
Interval of ticks this power needs to recharge before the power can be triggered again. |
hud_render |
Hud Render | {"should_render": false} |
Determines how the cooldown of this power is visualized on the HUD. |
key |
Key | {"key": "key.origins.primary_active"} |
Which active key this power should respond to. |
Examples
{
"type": "origins:active_self",
"entity_action": {
"type": "origins:if_else",
"condition": {
"type": "origins:on_fire"
},
"if_action": {
"type": "origins:extinguish"
},
"else_action": {
"type": "origins:set_on_fire",
"duration": 8
}
},
"cooldown": 20,
"hud_render": {
"should_render": false
}
}
This example will set the player on fire for 8 seconds, or extinguish themselves if they're already on fire upon pressing the Primary ability key.
{
"type": "origins:active_self",
"entity_action": {
"type": "origins:and",
"actions": [
{
"type": "origins:equipped_item_action",
"equipment_slot": "mainhand",
"action": {
"type": "origins:consume",
"amount": 1
}
},
{
"type": "origins:apply_effect",
"effect": {
"effect": "minecraft:speed",
"duration": 100,
"amplifier": 1,
"is_ambient": true,
"show_particles": true,
"show_icon": true
}
}
]
},
"cooldown": 1,
"hud_render": {
"should_render": false
},
"key": {
"key": "key.use",
"continuous": true
},
"condition": {
"type": "origins:equipped_item",
"equipment_slot": "mainhand",
"item_condition": {
"type": "origins:ingredient",
"ingredient": {
"item": "minecraft:sugar"
}
}
}
}
This example will allow the player that has the power to essentially consume a Sugar item if the player is holding a Sugar item, which would then apply a Speed II status effect that would last for 5 seconds upon pressing the key.use
keybind.
(The example is bound to the key.use
keybind, as seen inside the key
object field.)