[SPIGOT-4911] java.lang.IllegalArgumentException: Item ItemStack{FIREWORK_ROCKET x 1} is not an arrow Created: 11/May/19  Updated: 12/May/19  Resolved: 12/May/19

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Intelli Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: 1.14

Version: This server is running CraftBukkit version git-Spigot-1eece4f-8879c31 (MC: 1.14) (Implementing API version 1.14-R0.1-SNAPSHOT)
Guidelines Read: Yes

 Description   

When attempting to add a Firework to a Crossbow via the API (https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/meta/CrossbowMeta.html#addChargedProjectile-org.bukkit.inventory.ItemStack-), I receive the following error:

[17:37:14] [Server thread/WARN]: java.lang.IllegalArgumentException: Item ItemStack

Unknown macro: {FIREWORK_ROCKET x 1}

is not an arrow
[17:37:14] [Server thread/WARN]: at com.google.common.base.Preconditions.checkArgument(Preconditions.java:191)
[17:37:14] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_14_R1.inventory.CraftMetaCrossbow.addChargedProjectile(CraftMetaCrossbow.java:144)
[17:37:14] [Server thread/WARN]: at net.coreprotect.database.Lookup.populateItemStack(Lookup.java:2090)
[17:37:14] [Server thread/WARN]: at net.coreprotect.database.Lookup.populateItemStack(Lookup.java:2154)
[17:37:14] [Server thread/WARN]: at net.coreprotect.database.Lookup.access$000(Lookup.java:79)
[17:37:14] [Server thread/WARN]: at net.coreprotect.database.Lookup$2.run(Lookup.java:1848)
[17:37:14] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_14_R1.scheduler.CraftTask.run(CraftTask.java:81)
[17:37:14] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_14_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:394)
[17:37:14] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.MinecraftServer.b(MinecraftServer.java:1008)
[17:37:14] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.DedicatedServer.b(DedicatedServer.java:396)
[17:37:14] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.MinecraftServer.a(MinecraftServer.java:956)
[17:37:14] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.MinecraftServer.run(MinecraftServer.java:801)
[17:37:14] [Server thread/WARN]: at java.base/java.lang.Thread.run(Thread.java:834)

This is due to the following line of code:
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaCrossbow.java#144

Fireworks can be loaded into Crossbows in addition to arrows.
https://minecraft.gamepedia.com/Crossbow#Fireworks

getChargedProjectiles​() correctly returns Fireworks in the API, the issue is just when attempting to set the item.

Thanks!


Generated at Tue Apr 22 04:54:52 UTC 2025 using Jira 10.3.5#10030005-sha1:190c783f2bd6c69cd5accdb70f97e48812a78d14.