minecraft:shooter for you with a switch.Get GodCraftOverview
minecraft:shooter is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Sets which projectile the entity fires with its ranged attack. The ranged attack behavior reads this to know what to shoot.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
aux_val | Integer | "-1" | Potion effect ID put on the default projectile. |
def | String | none | Entity used as the default projectile; it needs the projectile component. |
magic | Boolean | "false" | If true, the attack counts as magic and won't run together with other magic behaviors like drinking potions. |
power | Decimal | "0.00" | Launch speed of the projectile; 0 uses the projectile's own default. |
projectiles | List | none | Projectiles to choose from, checked in order; the first one whose filter passes is used. |
sound | String | none | Sound played when the entity shoots. |
Example
Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):
BP/entities/<name>.json
{
"minecraft:shooter": {
"aux_val": "-1",
"def": "",
"magic": "false",
"power": "0.00",
"projectiles": {},
"sound": ""
}
}