Cannot make guns with item types that have a secondary data value #391

  • mmfire118 created this issue Oct 18, 2019

    I have looked through the github page explaing crafting and item types, but I cannot figure out how to make ammo for a weapon that has a secondary data value. I want to make it so that you have to use 1 stone to craft one assault rifle ammo which will be used as ammo for a gun. I am stuck as I cannot create an item with a secondary data value even when using a tilde such as (332~2). I get an error in-game when I do this and try to use the /shot get command: You have failed to provide a value for 'Item_Type' I will paste what I have tried below.




            Item_Name: "&eAssault Ammo"

            Item_Type: 332~2

            Item_Lore: "&eAssault Rifle Ammo"

            Sounds_Acquired: BAT_TAKEOFF-1-1-0


            Enable: true

            Quantity: 1

            Shaped: false

            Ingredients: stone


    Also in the console on reloading the config I get the following warnings:


    [22:33:07] [Server thread/WARN]: Unexpected exception while parsing console command "shot config reload"

    org.bukkit.command.CommandException: Unhandled exception executing command 'shot' in plugin CrackShot v0.98.9

                    at org.bukkit.command.PluginCommand.execute( ~[patched_1.14.4.jar:git-Paper-199]

                    at org.bukkit.command.SimpleCommandMap.dispatch( ~[patched_1.14.4.jar:git-Paper-199]

                    at org.bukkit.craftbukkit.v1_14_R1.CraftServer.dispatchCommand( ~[patched_1.14.4.jar:git-Paper-199]

                    at org.bukkit.craftbukkit.v1_14_R1.CraftServer.dispatchServerCommand( ~[patched_1.14.4.jar:git-Paper-199]

                    at net.minecraft.server.v1_14_R1.DedicatedServer.handleCommandQueue( ~[patched_1.14.4.jar:git-Paper-199]

                    at net.minecraft.server.v1_14_R1.DedicatedServer.b( ~[patched_1.14.4.jar:git-Paper-199]

                    at net.minecraft.server.v1_14_R1.MinecraftServer.a( ~[patched_1.14.4.jar:git-Paper-199]

                    at ~[patched_1.14.4.jar:git-Paper-199]

                    at Source) [?:1.8.0_221]

    Caused by: java.lang.IllegalArgumentException: Result cannot be null

                    at org.apache.commons.lang.Validate.notNull( ~[patched_1.14.4.jar:git-Paper-199]

                    at org.bukkit.craftbukkit.v1_14_R1.CraftServer.getRecipesFor( ~[patched_1.14.4.jar:git-Paper-199]

                    at com.shampaggon.crackshot.CSMinion.clearRecipes( ~[?:?]

                    at com.shampaggon.crackshot.CSDirector.onCommand( ~[?:?]

                    at org.bukkit.command.PluginCommand.execute( ~[patched_1.14.4.jar:git-Paper-199]

                    ... 8 more


  • mmfire118 posted a comment Oct 18, 2019

    I got rid of the warnings by deleting the config folder and reloading it. I still get the same error when running the above ammo in the defaultWeapons.yml file. Also I tried changing the crafting recipe to needing 2 stone instead of 1 for 1 ammo in the event the crafting recipe for a stone button was interfering for some reason, but the same thing happened.

  • crunchiemunchies420 posted a comment Jan 26, 2020

    I think it depends on the game version. As of late, crackshot can use name values instead of just numbers (Names are more reliable since item ids have been modified on version 1.13)

    I can use "Item_Type: stone_hoe" instead of looking up the id for the stone hoe.

    Maybe try that

    Edited Jan 26, 2020

To post a comment, please login or register a new account.