Origins: Powerful Powers
» AttributesPage 7 of 17

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:

mcfunction
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 10

The 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 /attribute and execute store.
  • In Origins, with origins:attribute. Attributes are synced to clients, so this is how to use OPP values in hud_render conditions and other client-checked places (see page 1).

    json
    {
      "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 1 or 0.
  • Values are clamped to the range below. For example, time_since_last_meal stops at 1,000,000,000.
  • Leave them unchanged, except drag. The base value is overwritten every tick, and a modifier added with /attribute … modifier add stays and makes get return a wrong value.

The list

Attribute (origins-powerful-powers:…)ValueRangeCondition
attack_cooldown_progresshow charged the attack is0 to 1attack_cooldown_progress
hurt_timehurt animation ticks left0 to 40hurt_time
invulnerable_ticksinvulnerability ticks left0 to 40invulnerable_ticks
velocity_x / velocity_y / velocity_zvelocity, blocks per tick−16 to 16velocity
look_pitchup/down look angle−90 to 90look_angle
look_yawleft/right look angle−180 to 180look_angle
is_jumping1 while jumping0 / 1is_jumping
crouch_depthsneak transition0 to 1crouch_depth
exhaustionfood exhaustion0 to 40exhaustion
xp_progressprogress to next level0 to 1xp_progress
biome_temperaturebiome base temperature−2 to 2biome_temperature
regional_difficultylocal difficulty0 to 6.75regional_difficulty
light_at_eyeslight level at eye height0 to 15light_at_eyes
last_attack_reachdistance of your last attack0 to 32last_attack_reach
recent_damage_takendamage taken in the last 60 ticks0 to 2048recent_damage_taken (whose window you can change)
recent_damage_blockeddamage blocked with a shield in the last 60 ticks0 to 2048recent_damage_blocked (whose window you can change)
vibration_cooldownvibration cooldown ticks left0 to 2400vibration_on_cooldown
vibration_on_cooldown1 while on cooldown0 / 1vibration_on_cooldown
is_blocking1 while blocking with a shield0 / 1is_blocking
critical_hit_eligible1 while a hit would crit0 / 1critical_hit_eligible
last_damage_amountyour last hit's damage0 to 2048last_damage_amount
recent_knockbackyour last knockback's strength0 to 16recent_knockback
time_airborneticks since last on the ground0 to 72000time_airborne
sprint_ticksticks sprinting without a break0 to 72000sprint_ticks
submersion_depthfluid blocks above your eyes0 to 16submersion_depth
glide_ratioforward ÷ downward speed while gliding (0 otherwise)0 to 1000glide_ratio
time_since_last_mealticks since you last ate0 to 1,000,000,000time_since_last_meal
distance_to_nearest_playerblocks to the closest other player0 to 1,000,000distance_to_nearest_player
last_death_distanceblocks 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,000none. In code, Death.distance()
redstone_powerredstone signal reaching the block at your feet0 to 15redstone_power
moon_phasemoon phase0 to 7moon_phase
frictioneffective slipperiness of the block you move on0 to 2friction
is_moving_loudly1 while moving loudly0 / 1is_moving_loudly
mainhand_cooldownvanilla cooldown ticks left on the item in your main hand0 to 1,000,000,000item_on_cooldown
voice_installed1 with Simple Voice Chat connected0 / 1voice_installed
voice_mic_disabled1 with voice chat disabled0 / 1voice_mic_disabled
is_talking1 while talking0 / 1is_talking
is_whispering_voice1 while whispering0 / 1is_whispering
in_voice_group1 while in a voice group0 / 1in_voice_group
is_broadcasting_voice1 while broadcasting0 / 1is_broadcasting_voice
is_muted_voice1 while force-muted0 / 1is_muted_voice
is_deafened_voice1 while force-deafened0 / 1is_deafened_voice
is_downed1 while downed (needs Hardcore Revival)0 / 1is_downed

Two conditions map to more than one attribute:

  • The velocity condition's axes are the three velocity_* attributes.
  • look_angle is split into look_pitch and look_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.

mcfunction
attribute @s origins-powerful-powers:drag base set 0.9

Falling caps around 0.72 blocks/tick, down from vanilla's 3.92. It's a permanent, gentler fall, like a weak Slow Falling.

mcfunction
attribute @s origins-powerful-powers:drag base set 0.995

Falling caps around 15.92 blocks/tick, about four times vanilla's terminal velocity.

dragFall caps aroundFeel
0.00hovers
0.50.08 blocks/tickvery heavy air resistance
0.90.72 blocks/tickgentle, like slow falling
0.98 (default)3.92 blocks/tickvanilla
0.99515.92 blocks/tickfast
1.0never capsfree-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.