Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.8] Item jerks around in hand when NBT data is being changed.


Recommended Posts

Hey, I have an item which has 2 timers stored in NBT, a cooldown and a time remaining counter. For some reason, if the NBT is being modified, the item does some crazy jumping thing if you hold it in your hand (Like when you right click an item on the ground, except constant). I don't remember this being an issue in 1.7.

 

Here is my code: http://pastebin.com/C9ZrfKVY

 

Any help would be much appreciated!

Link to post
Share on other sites

Do you need to handle the cooldown in that manner? One alternative would be to store its last use time (

World#getTotalWorldTime

) in the NBT and just compare that to the current time when the player tries to use it. I do something like this here.

 

If you have to handle the cooldown like this, override

Item#shouldCauseReequipAnimation

to ignore the NBT of the stacks.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.