Posted November 26, 20177 yr Im doing quiver for my mod, it has nbt "arrows" that stores arrow amount, and i want this arrows to be usable by the bow, how do i do this? [SOLVED] I made 2 quivers, one with arrows, with extends ItemArrow, and one blank, which extends Item, overrided some methods in both, and my quiver is now working. If anyone interested how I did it check my code at github, files ItemQuiver and ItemQuiverWithArrows. Edited November 26, 20177 yr by LavX64
November 26, 20177 yr Just create a Method that reduces your arrow count every time you shoot with your bow. If the Arrow NBT is 0, no arrows can be shot anymore. I think there are similar Methods existing, something like consumeItem() if I remember correctly. You should post more exact on what your problem is and show your Code. Maybe you could also use item capabilities for this
November 26, 20177 yr Author 18 minutes ago, ArmamentHaki said: Just create a Method that reduces your arrow count every time you shoot with your bow. If the Arrow NBT is 0, no arrows can be shot anymore. I think there are similar Methods existing, something like consumeItem() if I remember correctly. You should post more exact on what your problem is and show your Code. Maybe you could also use item capabilities for this I already have an idea of sonsuming item, the problem is to make bow find my arrows in my quiver, to be exact - find arrows in my inventory OR my quiver with AT LEAST 1 Arrow count in it
November 26, 20177 yr You could make your quiver extend Arrow and then you would only need to make sure that instead of the quiver, its arrows are consumed. Otherwise I am not sure how this would work as you cannot change Minecrafts Code directly. Or you could iterate through your inventory until a quiver with one arrow is found. Again, I am not sure if this works in practise.
November 26, 20177 yr Author 2 hours ago, ArmamentHaki said: You could make your quiver extend Arrow and then you would only need to make sure that instead of the quiver, its arrows are consumed. Otherwise I am not sure how this would work as you cannot change Minecrafts Code directly. Or you could iterate through your inventory until a quiver with one arrow is found. Again, I am not sure if this works in practise. It's okay, thank you for help but I already did my quiver.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.