Origins: Powerful Powers
» Entity conditions » Friction

Friction

origins-powerful-powers:frictionentity condition

The friction the entity gets from the block it's moving on. It's that block's slipperiness, after any origins:modify_slipperiness powers the entity has that apply to that block.

FieldTypeDefaultDescription
comparisonComparisonrequired
compare_toFloatrequiredslipperiness
  • Block values: 0.6 for most blocks, 0.8 for slime blocks, 0.98 for ice, packed ice and frosted ice, and 0.989 for blue ice. Higher is slipperier.
  • The block is the one vanilla uses for movement: half a block below the feet. That position and the power modifiers are taken exactly as Origins applies them. (From source: Apoli 2.9.2 LivingEntityMixin.)
  • In the air it reads the block half a block below, usually air (0.6). Vanilla only uses block friction on the ground, so add origins:on_block when that matters.
  • Effective value. This condition and its attribute include power modifiers. For a block's own slipperiness, use origins:on_block with an origins:slipperiness block condition.

Example: skates. Faster on anything slippery.

json
{
  "type": "origins:conditioned_attribute",
  "condition": {
    "type": "origins:and",
    "conditions": [
      {
        "type": "origins:on_block"
      },
      {
        "type": "origins-powerful-powers:friction",
        "comparison": ">=",
        "compare_to": 0.9
      }
    ]
  },
  "modifier": {
    "attribute": "minecraft:generic.movement_speed",
    "operation": "multiply_base",
    "value": 0.3
  },
  "tick_rate": 10
}

On ice, blue ice, or ground a modify_slipperiness power has made slippery, you move 30% faster.

Attribute: friction (clamped to 0 to 2)