Attributes
OPP registers 45 read-only attributes on every player, mirroring its conditions and refreshed at the end of every server tick. It also adds one settable attribute, drag, on every living entity. You can read them without any power:
attribute @s origins-powerful-powers:time_airborne get
execute store result score @s sprint run attribute @s origins-powerful-powers:sprint_ticks get
execute store result score @s speed10 run attribute @s origins-powerful-powers:velocity_y get 10The last number (10) is /attribute's scale. Scores are whole numbers, so scale up to keep decimals.
Where to use them:
- In commands and functions, through
/attributeandexecute store. In Origins, with
origins:attribute. Attributes are synced to clients, so this is how to use OPP values inhud_renderconditions and other client-checked places (see page 1).{ "type": "origins:attribute", "attribute": "origins-powerful-powers:crouch_depth", "comparison": ">=", "compare_to": 1 }- In variable code, by storing the attribute in a score and reading it with
Scoreboard.get.
Rules:
- Players only, except
drag. - Yes/no values are
1or0. - Values are clamped to the range below. For example,
time_since_last_mealstops at 1,000,000,000. - Leave them unchanged, except
drag. The base value is overwritten every tick, and a modifier added with/attribute … modifier addstays and makesgetreturn a wrong value.
The list
Attribute (origins-powerful-powers:…) | Value | Range | Condition |
|---|---|---|---|
attack_cooldown_progress | how charged the attack is | 0 to 1 | attack_cooldown_progress |
hurt_time | hurt animation ticks left | 0 to 40 | hurt_time |
invulnerable_ticks | invulnerability ticks left | 0 to 40 | invulnerable_ticks |
velocity_x / velocity_y / velocity_z | velocity, blocks per tick | −16 to 16 | velocity |
look_pitch | up/down look angle | −90 to 90 | look_angle |
look_yaw | left/right look angle | −180 to 180 | look_angle |
is_jumping | 1 while jumping | 0 / 1 | is_jumping |
crouch_depth | sneak transition | 0 to 1 | crouch_depth |
exhaustion | food exhaustion | 0 to 40 | exhaustion |
xp_progress | progress to next level | 0 to 1 | xp_progress |
biome_temperature | biome base temperature | −2 to 2 | biome_temperature |
regional_difficulty | local difficulty | 0 to 6.75 | regional_difficulty |
light_at_eyes | light level at eye height | 0 to 15 | light_at_eyes |
last_attack_reach | distance of your last attack | 0 to 32 | last_attack_reach |
recent_damage_taken | damage taken in the last 60 ticks | 0 to 2048 | recent_damage_taken (whose window you can change) |
recent_damage_blocked | damage blocked with a shield in the last 60 ticks | 0 to 2048 | recent_damage_blocked (whose window you can change) |
vibration_cooldown | vibration cooldown ticks left | 0 to 2400 | vibration_on_cooldown |
vibration_on_cooldown | 1 while on cooldown | 0 / 1 | vibration_on_cooldown |
is_blocking | 1 while blocking with a shield | 0 / 1 | is_blocking |
critical_hit_eligible | 1 while a hit would crit | 0 / 1 | critical_hit_eligible |
last_damage_amount | your last hit's damage | 0 to 2048 | last_damage_amount |
recent_knockback | your last knockback's strength | 0 to 16 | recent_knockback |
time_airborne | ticks since last on the ground | 0 to 72000 | time_airborne |
sprint_ticks | ticks sprinting without a break | 0 to 72000 | sprint_ticks |
submersion_depth | fluid blocks above your eyes | 0 to 16 | submersion_depth |
glide_ratio | forward ÷ downward speed while gliding (0 otherwise) | 0 to 1000 | glide_ratio |
time_since_last_meal | ticks since you last ate | 0 to 1,000,000,000 | time_since_last_meal |
distance_to_nearest_player | blocks to the closest other player | 0 to 1,000,000 | distance_to_nearest_player |
last_death_distance | blocks to where you last died (the recovery compass's target). −1 if you've never died or died in another dimension | −1 to 100,000,000 | none. In code, Death.distance() |
redstone_power | redstone signal reaching the block at your feet | 0 to 15 | redstone_power |
moon_phase | moon phase | 0 to 7 | moon_phase |
friction | effective slipperiness of the block you move on | 0 to 2 | friction |
is_moving_loudly | 1 while moving loudly | 0 / 1 | is_moving_loudly |
mainhand_cooldown | vanilla cooldown ticks left on the item in your main hand | 0 to 1,000,000,000 | item_on_cooldown |
voice_installed | 1 with Simple Voice Chat connected | 0 / 1 | voice_installed |
voice_mic_disabled | 1 with voice chat disabled | 0 / 1 | voice_mic_disabled |
is_talking | 1 while talking | 0 / 1 | is_talking |
is_whispering_voice | 1 while whispering | 0 / 1 | is_whispering |
in_voice_group | 1 while in a voice group | 0 / 1 | in_voice_group |
is_broadcasting_voice | 1 while broadcasting | 0 / 1 | is_broadcasting_voice |
is_muted_voice | 1 while force-muted | 0 / 1 | is_muted_voice |
is_deafened_voice | 1 while force-deafened | 0 / 1 | is_deafened_voice |
is_downed | 1 while downed (needs Hardcore Revival) | 0 / 1 | is_downed |
Two conditions map to more than one attribute:
- The
velocitycondition's axes are the threevelocity_*attributes. look_angleis split intolook_pitchandlook_yaw.
The voice-chat condition is_whispering is the attribute is_whispering_voice.
These conditions have no attribute: has_attack_target, projectile_age, last_damage_type, is_sleeping, stat, last_hit_was_crit, last_damage_was_crit and has_power_tag, plus the bi-entity conditions.
last_death_distance is the one attribute with no condition. Check it with origins:attribute, for example "comparison": "<=", "compare_to": 16 for "within 16 blocks of your last death". Add a second check with ">=", 0 to leave out "never died" (−1).
Drag
origins-powerful-powers:dragevery living entitysettable
A normal vanilla-style attribute, like generic.movement_speed. /attribute ... base set and Origins attribute modifiers stick.
It replaces vanilla's fall-drag constant: the fraction of downward speed an entity keeps each tick while falling through open air. Swimming, lava, elytra gliding, climbing and the upward half of a jump use vanilla physics. The default 0.98 is the vanilla constant. The drag value sets the terminal velocity, as in the table below.
attribute @s origins-powerful-powers:drag base set 0.9Falling caps around 0.72 blocks/tick, down from vanilla's 3.92. It's a permanent, gentler fall, like a weak Slow Falling.
attribute @s origins-powerful-powers:drag base set 0.995Falling caps around 15.92 blocks/tick, about four times vanilla's terminal velocity.
drag | Fall caps around | Feel |
|---|---|---|
0.0 | 0 | hovers |
0.5 | 0.08 blocks/tick | very heavy air resistance |
0.9 | 0.72 blocks/tick | gentle, like slow falling |
0.98 (default) | 3.92 blocks/tick | vanilla |
0.995 | 15.92 blocks/tick | fast |
1.0 | never caps | free-fall, accelerates forever |
- Jump height is unchanged. It only applies while the entity is moving downward or standing still, and gravity itself is untouched.
- Modifiers work normally. For a temporary change, add a modifier and remove it later with
modifier remove. - Slow Falling, Levitation, no-gravity and riding keep vanilla behavior. On any tick where vanilla's fall differs from plain open-air falling, OPP keeps the vanilla result.
- Player flying and swimming, and mobs with custom flight or swim code, keep vanilla behavior.