Jump to content

Recommended Posts

Posted

I am making a mod in minecraft 1.8, and one thing it can do is that when you right click  and hold it. It will 'charge' the item and do a different action then it would do if you just simply right clicked.

 

I want the user to know when it is done charging, and I thought that a that little ding caused by a arrow hitting a player would be perfect. However, I can't figure out how to do this. I tried using NBT as a way to store how much time is left for charging and whether or not it has played a sound effect. But that way doesn't work, as it just resets the timer because a different NBT tag makes MC think its a different item.

 

So any idea what I could?

 

Note, the charge time is configurable. So the charge time in the client's configs might be different in the server's config.

 

Posted

I looked into using getItemInUseCount. Problem with that is that is that is @SideOnly(Side.CLIENT), which if I remember right. Means that function doesn't exist server side, and the server is where the actual time needed to charge the item is stored.

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.