Skip to main content

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.

FieldTypeDefaultDescription
should_render_inactiveBooleantrueWhether to render when the resource is full/empty
sprite_locationIdentifierorigins:textures/gui/resource_bar.pngTexture for the bar
bar_indexInteger0Index of the bar in the sprite sheet
icon_indexInteger0Index of the icon in the sprite sheet
conditionEntity ConditionoptionalCondition for rendering the HUD element
invertedBooleanfalseIf true, inverts the bar direction
orderInteger0Render order among multiple HUD elements
caution

should_render is no longer supported for HUD elements. You can just remove HudRender from power to hide the HUD element, or use the condition field to control its visibility instead.


Key

Key binding settings.

FieldTypeDefaultDescription
keyStringkey.origins.primary_activeKey binding ID
continuousBooleanfalseWhether the key is treated as held continuously

Modifier

A mathematical modifier applied to numeric values.

FieldTypeDefaultDescription
valueFloatrequiredModifier value
operationStringadd_base_earlyOperation: add_base_early, multiply_base_additive, multiply_base_multiplicative, multiply_total_additive, multiply_total_multiplicative
resourceIdentifieroptionalResource to use as the modifier value
modifierModifieroptionalSub-modifier applied to the resource value

AttributeEntry

An attribute modifier entry.

FieldTypeDefaultDescription
attributeIdentifierrequiredAttribute ID (e.g. minecraft:generic.max_health)
operationStringrequiredOperation: add_value, add_multiplied_base, add_multiplied_total
valueFloatrequiredModifier value
nameStringoptionalCustom name for the modifier

PositionedItemStack

An item stack with an optional inventory slot position.

FieldTypeDefaultDescription
stackItem StackrequiredThe item stack
slotIntegeroptionalInventory slot index to place the item into

ColorSettings

RGBA color configuration.

FieldTypeDefaultDescription
redFloatoptionalRed channel (0-1)
greenFloatoptionalGreen channel (0-1)
blueFloatoptionalBlue channel (0-1)
alphaFloatoptionalAlpha channel (0-1)
colorIntegeroptionalARGB color as a single hex integer (0xAARRGGBB)

Space

Coordinate space definition for position-based powers and conditions. Currently only for origins:add_velocity.

ValueDescription
worldThe 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).
localThe 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_horizontalSame 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_normalizedSame 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)
velocityThe 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_normalizedSame 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_horizontalSame as velocity, except the vertical velocity is considered to be 0.
velocity_horizontal_normalizedSame 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)