Held item resets when player is given an item

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

ketchup_god

New Member
Jan 1, 2020
6
0
0
74
I want to give the player an arrow every five seconds, but the held item always goes down (and resets bow charging) whenever an arrow is given. How do you give players items without this happening?
 
Last edited:
But there have been many servers (and yes, I know they might have been coded in java, but still) where this doesn't happen. I know it is how minecraft works, but many people have worked around it, and I want to see if there is a way of doing so in skript. By the way, thanks for replying.
 
You're welcome.

From my understanding this was something that changed in the last few versions of Minecraft.
To my knowledge, when the player's tool is altered, it refreshes the item in their hand, hence the movement of the item.
To my knowledge, there is no way around this.

If people found a way around it, they're most likely using NMS (Minecraft's backend code), and this would be extremely difficult to do in Skript.
 
I want to give the player an arrow every five seconds, but the held item always goes down (and resets bow charging) whenever an arrow is given. How do you give players items without this happening?
What you can do is set variables to the measure of how long it takes to charge a bow with every state of the bow's charge, then set another variable to the current time and see if the difference between and now and the variable that was set to the current time is greater than the variables containing how long it takes to charge a bow into its states, if that makes sense. Doing this would allow you to know what state the bow was in when the item refreshed, and you could set the bow's chargeback state.

EDIT:
Nevermind, you can't set a bow's state :v
 
Status
Not open for further replies.