Entity Documentation - minecraft:behavior.target_when_pushed

minecraft:behavior.target_when_pushed compels an entity to target the entity that pushed it.

Parameters

Name Default Value Type Description
entity_types not set JSON Object List of entity types that this mob considers valid targets.
percent_chance 5.0 Decimal Probability that the entity will target the entity that pushed it.
priority not set Integer The higher the priority, the sooner this behavior will be executed as a goal.

Example

"minecraft:behavior.target_when_pushed": {
        "priority": 1,
        "percent_chance": 5.0,
        "entity_types": [
          {
            "filters": { 
              "all_of": [
                { "test" :  "is_family", "subject" : "other", "value" :  "monster" },
                { "test" :  "is_family", "subject" : "other", "operator": "!=", "value" :  "creeper" }
              ] 
            }
          }
        ]
      }

Vanilla entities examples

iron_golem

"minecraft:behavior.target_when_pushed": {
        "priority": 1,
        "percent_chance": 5.0,
        "entity_types": [
          {
            "filters": { 
              "all_of": [
                { "test" :  "is_family", "subject" : "other", "value" :  "monster" },
                { "test" :  "is_family", "subject" : "other", "operator": "!=", "value" :  "creeper" }
              ] 
            }
          }
        ]
      }

Vanilla entities using minecraft:behavior.target_when_pushed