How do you check which half of a block is rightclicked?

Started by Yusufhum3 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Dec 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do you check which half of a block is rightclicked?
Sat, 03/18/2023 - 12:14 (edited)

Does someone know a way/procedure to check if the player has rightclicked one half of a block or the other. I dont mean which face is rightclicked but which 16x16x8 section of a block (like a slab but sideways)

It should also work when there is SNWE rotation. When you rightclick the block it should first check which half is rightclicked and then do 2 different things depending on which half is rightclicked

This might be doable using a complex formula that calculates it depending on the position of the block, the position of the player, the players headpitch, direction yaw and the blocks direction (for the SNWE rotation) but I have no idea how to do it

Edited by Yusufhum3 on Sat, 03/18/2023 - 12:14