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

[1.13.2] How to check right click on the block by item in mainhand?


Recommended Posts

To get the block activation from the block side (as opposed to the item side), for example if you're making a new block, then use onBlockActivated. See here.

 

If you want to do it from the item side, use onItemRightClick. To get the block you're looking at you can use the client's (Minecraft.getInstance()) objectMouseOver field. If that doesn't have the block, you might have to get another field from objectMouseOver, probably a RayTraceResult (if I recall correctly). If you take this route you'll probably have to send the result from the client to the server using packets.

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.