Origins: Powerful Powers
» Entity actions » Action on fake entity hit

Action on fake entity hit

origins-powerful-powers:action_on_fake_entity_hitpower type

Runs when a player who can see one of the holder's fake entities hits it. The holder is the fake entity's spawner.

FieldTypeDefaultDescription
idIntegernoneOnly hits on this fake entity. Left out: any of the holder's fake entities.
entity_actionEntity actionnoneRuns on the holder.
bientity_actionBi-entity actionnoneThe actor is the player who hit it and the target is the fake entity.
bientity_conditionBi-entity conditionnoneSame actor and target. Only runs when this is true.
conditionEntity conditionnoneChecked on the holder, like any power.
  • It runs for every behavior. A passive fake entity also starts chasing whoever hit it.
  • The fake entity takes no damage or knockback. Use the actions to show the hit.

Example: a decoy that vanishes when it's hit and gives the attacker Slowness.

json
{
  "type": "origins-powerful-powers:action_on_fake_entity_hit",
  "bientity_action": {
    "type": "origins:and",
    "actions": [
      {
        "type": "origins:actor_action",
        "action": {
          "type": "origins:apply_effect",
          "effect": {
            "effect": "minecraft:slowness",
            "duration": 60
          }
        }
      },
      {
        "type": "origins:target_action",
        "action": {
          "type": "origins:execute_command",
          "command": "particle minecraft:poof ~ ~1 ~ 0.3 0.5 0.3 0 20"
        }
      }
    ]
  },
  "entity_action": {
    "type": "origins-powerful-powers:despawn_fake_entity"
  }
}

despawn_fake_entity without an id removes all of the holder's fake entities. With several out at once, give each an id and a matching action_on_fake_entity_hit.