Jump to content

[1.12.2] canceling onItemRightClick if onItemUse fired


Codasylph

Recommended Posts

I have a multi purpose tool in my mod (i.e. it does different things depending on whether you click in the air with it, or on a block, what kind of block, etc.) I'm wondering if there is any simple, reasonable way to prevent my code in Item#onItemRightClick from firing if Item#onItemUse already has.  I know from testing that onItemUse fires first, and doesn't fire if the user is clicking on air as opposed to a block (which nixes my brilliant plan of putting all the functionality in onItemUse.) I'm mostly just trying to prevent chat spam for the user because onItemRightClick sends a chat message to the client with information about the surroundings, and I think this will become irritating if the user is trying to use the tool to do something like adjust settings on one of my blocks which may involve a lot of clicking.

Edited by Codasylph
Link to comment
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.
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.



×
×
  • Create New...

Important Information

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