Jump to content

[1.7.10]Get the side of the block in which the player is pointing at


Cerandior

Recommended Posts

Well i made my 3x3 pickaxe based on player yaw and pitch. I am not happy though. Nit at all. After some testing i saw that the pickaxe is not very accurate. Sometimes instead of doing 3x3 when i am looking down it mines like iam looking forward. Is there a way to get ghe side of the block that i am pointing at. Like north, west, up, down. This way the mining would be pretty accurate without using the player yaw and pitch.

Link to comment
Share on other sites

i dont know if there is a straight way of doing this, but you could try comparing the player's position with the block's position, instead of using the player's view...

 

this might not be the optimal way of achieving your goal, but it may help you get a new vision on the subject :/

Link to comment
Share on other sites

Another option could be with Minecraft.getMinecraft().objectMouseOver which is the data type MovingObjectPosition. It can be used to reference not only the block position, but the side that was hit as well. I have used this to find the entity that a player is looking at, but should work just as well with blocks. Hope this helps ;D

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.

Announcements



×
×
  • Create New...

Important Information

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