Entity Documentation - minecraft:shooter

Defines the entity's ranged attack behavior. The "minecraft:behavior.ranged_attack" goal uses this component to determine which projectiles to shoot.

Note

Ammunition used by minecraft:shooter must have the minecraft:projectile component in order to function properly.

Shooter Properties

Name Default Value Type Description Example Values
aux_val -1 Integer number ID of the Potion effect for the default projectile to be applied on hit. Bogged: 26, Witch: 23
def not set String Actor definition to use as the default projectile for the ranged attack. The actor definition must have the projectile component to be able to be shot as a projectile. Blaze: "minecraft:small_fireball", Bogged: "minecraft:arrow", Drowned: "minecraft:thrown_trident"
magic false Boolean true/false Sets whether the projectiles being used are flagged as magic. If set, the ranged attack goal will not be used at the same time as other magic goals, such as minecraft:behavior.drink_potion Witch: true
power 0 Decimal number Velocity in which the projectiles will be shot at. A power of 0 will be overwritten by the default projectile throw power. Witch: 0.75, Axe Turret: 10, Bow Turret: 7
projectiles not set Array of strings List of projectiles that can be used by the shooter. Projectiles are evaluated in the order of the list; After a projectile is chosen, the rest of the list is ignored. Witch: [{"def":"minecraft:splash_potion","aux_val":21,"filters":{"all_of":[{"test":"is_raider","subject":"other","value":true},{"test":"actor_health","subject":"other","value":4,"operator":"<="}]},"lose_target":true},{"def":"minecraft:splash_potion","aux_val":28,"filters":{"all_of":[{"test":"is_raider","subject":"other","value":true}]},"lose_target":true},{"def":"minecraft:splash_potion","aux_val":17,"filters":{"all_of":[{"test":"target_distance","subject":"self","value":8,"operator":">="},{"none_of":[{"test":"has_mob_effect","subject":"other","value":"slowness"}]}]}},{"def":"minecraft:splash_potion","aux_val":25,"filters":{"all_of":[{"test":"actor_health","subject":"other","value":8,"operator":">="},{"none_of":[{"test":"has_mob_effect","subject":"other","value":"poison"}]}]}},{"def":"minecraft:splash_potion","aux_val":34,"filters":{"all_of":[{"test":"target_distance","subject":"self","value":3,"operator":"<="},{"none_of":[{"test":"has_mob_effect","subject":"other","value":"weakness"}]}]},"chance":0.25}]
sound not set String Sound that is played when the shooter shoots a projectile. Bogged: "bow", Drowned: "item.trident.throw", Witch: "throw"

Samples

Blaze

"minecraft:shooter": {
  "def": "minecraft:small_fireball"
}

Bogged

"minecraft:shooter": {
  "def": "minecraft:arrow",
  "sound": "bow",
  "aux_val": 26
}

Drowned

"minecraft:shooter": {
  "def": "minecraft:thrown_trident",
  "sound": "item.trident.throw"
}

Ender Dragon

"minecraft:shooter": {
  "def": "minecraft:dragon_fireball"
}

Ghast

"minecraft:shooter": {
  "def": "minecraft:fireball"
}

Llama

"minecraft:shooter": {
  "def": "minecraft:llama_spit"
}

Piglin

"minecraft:shooter": {
  "def": "minecraft:arrow"
}

Shulker

"minecraft:shooter": {
  "def": "minecraft:shulker_bullet"
}

Snow Golem

"minecraft:shooter": {
  "def": "minecraft:snowball"
}

Witch

"minecraft:shooter": {
  "power": 0.75,
  "def": "minecraft:splash_potion",
  "aux_val": 23,
  "sound": "throw",
  "projectiles": [
    {
      "def": "minecraft:splash_potion",
      "aux_val": 21,
      "filters": {
        "all_of": [
          {
            "test": "is_raider",
            "subject": "other",
            "value": true
          },
          {
            "test": "actor_health",
            "subject": "other",
            "value": 4,
            "operator": "<="
          }
        ]
      },
      "lose_target": true
    },
    {
      "def": "minecraft:splash_potion",
      "aux_val": 28,
      "filters": {
        "all_of": [
          {
            "test": "is_raider",
            "subject": "other",
            "value": true
          }
        ]
      },
      "lose_target": true
    },
    {
      "def": "minecraft:splash_potion",
      "aux_val": 17,
      "filters": {
        "all_of": [
          {
            "test": "target_distance",
            "subject": "self",
            "value": 8,
            "operator": ">="
          },
          {
            "none_of": [
              {
                "test": "has_mob_effect",
                "subject": "other",
                "value": "slowness"
              }
            ]
          }
        ]
      }
    },
    {
      "def": "minecraft:splash_potion",
      "aux_val": 25,
      "filters": {
        "all_of": [
          {
            "test": "actor_health",
            "subject": "other",
            "value": 8,
            "operator": ">="
          },
          {
            "none_of": [
              {
                "test": "has_mob_effect",
                "subject": "other",
                "value": "poison"
              }
            ]
          }
        ]
      }
    },
    {
      "def": "minecraft:splash_potion",
      "aux_val": 34,
      "filters": {
        "all_of": [
          {
            "test": "target_distance",
            "subject": "self",
            "value": 3,
            "operator": "<="
          },
          {
            "none_of": [
              {
                "test": "has_mob_effect",
                "subject": "other",
                "value": "weakness"
              }
            ]
          }
        ]
      },
      "chance": 0.25
    }
  ],
  "magic": true
}

Axe Turret

"minecraft:shooter": {
  "def": "minecraft:shulker_bullet",
  "power": 10
}

Bow Turret

"minecraft:shooter": {
  "def": "minecraft:arrow",
  "power": 7
}