Shared Data Types
These are complex data types that are referenced by multiple power types, actions, and conditions across Origins.
HudRender
Used by powers to display cooldown/resource bars in the HUD.
| Field | Type | Default | Description |
|---|---|---|---|
should_render_inactive | Boolean | true | Whether to render when the resource is full/empty; should_render is accepted as a compatibility alias |
sprite_location | Identifier | origins:textures/gui/resource_bar.png | Texture for the bar |
bar_index | Integer or Resource Reference | 0 | Index of the bar in the sprite sheet |
icon_index | Integer or Resource Reference | 0 | Index of the icon in the sprite sheet |
condition | Entity Condition | optional | Condition for rendering the HUD element |
inverted | Boolean | false | If true, inverts the bar direction |
order | Integer or Resource Reference | 0 | Render order among multiple HUD elements |
The Origins: Math parent-and-children list representation is also accepted for data compatibility.
Resource Reference
A Resource Reference can be either a literal number or the identifier of a resource power on the executing entity. Fields documented with this type evaluate the resource value when used.
5
"example:charge"
Missing resources and non-finite values resolve to 0.
Variables
Expression-enabled types accept an optional variables object which maps an expression variable name to a resource power identifier.
{
"expression": "charge * 0.25 + bonus",
"variables": {
"charge": "example:charge",
"bonus": "example:bonus"
}
}
Variable names must begin with a letter or _, and may then contain letters, digits, or _. Expressions use exp4j syntax; invalid or non-finite results resolve to 0.
variable_execute_command and variable_nbt_linked_resource can interpolate variables in strings:
| Form | Result |
|---|---|
$:name | Integer value of name |
${name} | Integer value of name |
${name:%d} | Integer value of name |
${name:%.2f} | Decimal value with a precision from 0 to 17 |
Key
Key binding settings.
| Field | Type | Default | Description |
|---|---|---|---|
key | String | key.origins.primary_active | Key binding ID |
continuous | Boolean | false | Whether the key is treated as held continuously |
Modifier
A mathematical modifier applied to numeric values.
Don't be confused with AttributeEntry, which is used for modifying entity attributes. This is a more general-purpose modifier that can be applied to any numeric value.
| Field | Type | Default | Description |
|---|---|---|---|
value | Float | required | Modifier value |
operation | String | add_base_early | Operation: add_base_early, multiply_base_additive, multiply_base_multiplicative, multiply_total_additive, multiply_total_multiplicative |
resource | Identifier | optional | Resource to use as the modifier value |
modifier | Modifier | optional | Sub-modifier applied to the resource value |
AttributeEntry
An attribute modifier entry.
Don't be confused with Modifier, which is a more general-purpose modifier that can be applied to any numeric value. This is specifically for modifying entity attributes.
| Field | Type | Default | Description |
|---|---|---|---|
attribute | Identifier | required | Attribute ID (e.g. minecraft:generic.max_health) |
operation | String | required | Operation: add_value, add_multiplied_base, add_multiplied_total |
value | Float | required | Modifier value |
name | String | optional | Custom name for the modifier |
PositionedItemStack
An item stack with an optional inventory slot position.
| Field | Type | Default | Description |
|---|---|---|---|
stack | Item Stack | required | The item stack |
slot | Integer | optional | Inventory slot index to place the item into |
ColorSettings
RGBA color configuration.
| Field | Type | Default | Description |
|---|---|---|---|
red | Float | optional | Red channel (0-1) |
green | Float | optional | Green channel (0-1) |
blue | Float | optional | Blue channel (0-1) |
alpha | Float | optional | Alpha channel (0-1) |
color | Integer | optional | ARGB color as a single hex integer (0xAARRGGBB) |
EffectEntry
Effect configuration for powers that apply effects.
You can just use a resource location string (e.g. minecraft:strength) instead of an EffectEntry object if you don't need to customize the effect.
| Field | Type | Default | Description |
|---|---|---|---|
effect | Identifier | required | Effect ID |
amplifier | Integer | 0 | Base amplifier |
show_particles | Boolean | true | Whether to show particles |
show_icon | Boolean | true | Whether to show the icon |
Shape
Indicate how to select blocks/entities in a region. Should be used with distance.
| Value | Formula |
|---|---|
cube | max(x,y,z) |
star | ` |
sphere | x^2 + y^2 + z^2 |
Space
Coordinate space definition for position-based powers and conditions. Currently only for origins:add_velocity.
| Value | Description |
|---|---|
world | The axes are global: x points to west (negative) or east (positive), y points to bottom (negative) or top (positive) and z points to north (negative) or south (positive). |
local | The axes are local to the entity: x points to its left side and is always horizontal, y points to the top of the entity's head and z points to the direction the entity is facing. |
local_horizontal | Same as local, except it considers the vertical length of the direction of the entity is facing to be 0, resulting in z being projected (flattened out) onto the horizontal plane, making it shorter. x and y also become shorter by the same amount and y always points upwards. The axes shrink as the direction the entity is facing diverges from being horizontal. (e.g: if the entity is looking straight up or straight down, the axes will have a length of 0, akin to forcing x, y and z to be 0) |
local_horizontal_normalized | Same as local_horizontal, except the axes are normalized. (e.g: the axes' length are brought back to its previous length of 1 if it's of non-zero length) |
velocity | The axes are local to the entity's velocity, similar to local. If the velocity is purely vertical, the way the entity is pointing is used to determine the direction of x and y instead of the velocity. The axes scale based on how fast the entity is moving. (e.g: if the entity is not moving, the axes will have a length of 0, akin to forcing x, y and z to be 0) |
velocity_normalized | Same as velocity, except the axes are normalized. (e.g: the axes' length are brought back to its previous length of 1 if it's of non-zero length, making it not depend on the speed of the entity's movement, only as long as the entity is moving) |
velocity_horizontal | Same as velocity, except the vertical velocity is considered to be 0. |
velocity_horizontal_normalized | Same as velocity_horizontal, except the axes are normalized. (e.g: the axes' length are brought back to its previous length of 1 if it's of non-zero length) |
Stat Reference
A Stat Reference is a value type used by stat-related actions and conditions to specify which Minecraft statistic to
target. It accepts two forms: a simple form for custom stats, and a typed form for stats that have a variant (
such as block/item/entity type).
Simple Form
For stats registered under the minecraft:custom StatType (e.g. jumps, deaths, distance traveled), just use a
ResourceLocation:
"minecraft:jump"
"minecraft:deaths"
Typed Form
For stats that have a variant value, use an object with stat_type and id:
| Field | Type | Default | Description |
|---|---|---|---|
stat_type | Identifier | required | The Stat Type ID. |
id | Identifier | required | The registry ID of the specific block, item, or entity type. |
{
"stat_type": "minecraft:mined",
"id": "minecraft:diamond_ore"
}
Vanilla Stat Types
| StatType ID | Value Registry | Description |
|---|---|---|
minecraft:mined | Block | Blocks broken |
minecraft:crafted | Item | Items crafted |
minecraft:used | Item | Items used |
minecraft:broken | Item | Items broken (durability exhausted) |
minecraft:picked_up | Item | Items picked up |
minecraft:dropped | Item | Items dropped |
minecraft:killed | EntityType | Entities killed |
minecraft:killed_by | EntityType | Deaths by entity |
minecraft:custom | CustomStat | General stats (jump, deaths, walk_one_cm, etc.) |
For the minecraft:custom stat type, use the simple form (a plain
ResourceLocation) instead of the typed form.
Weighted Sound Entry
A Weighted Sound Entry is a value type used to define a sound with a weight for use in sound-related actions and conditions. It accepts an object with sound and weight fields:
| Field | Type | Default | Description |
|---|---|---|---|
sound | Identifier or List | required | The sound ID. |
weight | Float | required | The weight of the sound (higher = more likely to play). |
{
"sound": "minecraft:entity.player.death",
"weight": 1.0
}