Origins: Powerful Powers
» Entity conditions » Recent knockback

Recent knockback

origins-powerful-powers:recent_knockbackentity conditiontracked

The strength of the last knockback the entity received. Vanilla melee knockback is about 0.4, and the Knockback enchantment adds more.

FieldTypeDefaultDescription
comparisonComparisonrequired
compare_toDoublerequired
  • It's the strength vanilla asked for, before knockback resistance reduces it.
  • It keeps its value until the next knockback.

Example:

json
{
  "type": "origins:action_over_time",
  "interval": 1,
  "condition": {
    "type": "origins:and",
    "conditions": [
      {
        "type": "origins-powerful-powers:hurt_time",
        "comparison": ">=",
        "compare_to": 9
      },
      {
        "type": "origins-powerful-powers:recent_knockback",
        "comparison": ">=",
        "compare_to": 1.0
      }
    ]
  },
  "entity_action": {
    "type": "origins:apply_effect",
    "effect": {
      "effect": "minecraft:slow_falling",
      "duration": 40,
      "amplifier": 0
    }
  }
}

When you're knocked back hard, you get Slow Falling so you don't take fall damage.

Attribute: recent_knockback