Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-4911

java.lang.IllegalArgumentException: Item ItemStack{FIREWORK_ROCKET x 1} is not an arrow

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • This server is running CraftBukkit version git-Spigot-1eece4f-8879c31 (MC: 1.14) (Implementing API version 1.14-R0.1-SNAPSHOT)
    • Yes

      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!

            Unassigned Unassigned
            Intelli Intelli
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: