Jump to content

Recommended Posts

Posted (edited)

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 by LavX64
Posted

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

Posted
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

Posted

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.

Posted
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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.