#Why won't my item shoot? (been at this for a few hours and still can't get it to work)

15 messages · Page 1 of 1 (latest)

harsh hazel
#

Copied code from here: #old-items message and my item still did not shoot. Also no error message. I suspect it might be the format version but when I tried to change it to 1.16 the resource pack broke and it still did not shoot. Any help is apricated. Cheers!

BP:

    "format_version": "1.10",
    "minecraft:item": {
        "description": {
            "identifier": "wiki:lapisStaff"
        },
        "components": {
            "minecraft:max_stack_size": 1,
            "minecraft:use_duration": 3600,
            "minecraft:frame_count": 3,
            "minecraft:animates_in_toolbar": false,
            "minecraft:enchantable": {
              "slot": "bow",
              "value": 1
            },
            "minecraft:hand_equipped": true,
            "minecraft:shooter": {
                "ammunition": [
                  {
                    "item": "minecraft:arrow",
                    "use_offhand": true,
                    "search_inventory": true,
                    "use_in_creative": true
                  }
                ],
                "charge_on_draw": false,
                "max_draw_duration": 1,
                "scale_power_by_draw_duration": true
            },
            "minecraft:damageable": {
              "max_damage": 384
            }
          }
    }
} ```
RP:
```{
    "format_version": "1.10",
    "minecraft:item": {
        "description": {
            "identifier": "wiki:lapisStaff",
            "category": "Equipment"
        },
        "components": {
            "minecraft:icon": "lapisStaff",
            "minecraft:render_offsets": "tools"
        }
    }
}```
thorn gale
#

Making items that shoot requires two things: A shooter item with the "minecraft:shooter" component, and an ammunition item with the "minecraft:projectile" component.

A shooter may only shoot projectiles if the ammunition item has that component. Arrows are not data driven with this component yet, and as such cannot be used for shooting items.

#

Now for your item, you were right in thinking that the format version must be different. Set it to "1.16.100" since the old item format (1.10) does not support "minecraft:shooter" or "minecraft:projectile".

To fix that resource pack error, we need to delete the RP item file entirely. As for the two components in that file ("minecraft:icon" and "minecraft:render_offsets) we will move them into the behavior pack's item file.

ocean thicket
thorn gale
#

You must not have passed an array for the ammunition. Did you set it to a string or an object?

#

(Also the format version is too high)

ocean thicket
ocean thicket
thorn gale
#

It says in the error

ocean thicket
thorn gale
#

1.16.100?

ocean thicket
thorn gale
#

1.16.100 should eliminate the first error.

#

The second error is because "ammunition": "musket_ball" is invalid; refer to how Burnt Toast wrote it in their post

ocean thicket