minecraft:shooter for you with a switch.Get GodCraftOverview
minecraft:shooter is an item component: it goes in the components object of a custom item. Makes the item a launcher, like a bow or crossbow, that fires ammo from the inventory. Pair it with minecraft:use_modifiers so the player can hold it to draw.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
ammunition | Ammunition[] | none | List of items it can fire, and options like using the off hand or ignoring ammo in Creative. |
max_draw_duration | number | 0 | Seconds needed to fully draw the item. |
scale_power_by_draw_duration | boolean | false | When true, shots are stronger the longer the player draws. |
charge_on_draw | boolean | false | When true, the item loads while drawing and fires on the next use, like a crossbow. |
Example
Inside the components object of BP/items/<name>.json (values are the defaults or placeholders):
BP/items/<name>.json
{
"minecraft:shooter": {
"ammunition": [],
"max_draw_duration": 0,
"scale_power_by_draw_duration": false,
"charge_on_draw": false
}
}