How do I grab the coordinates of the block a player is looking at?

Started by Stewie on

Topic category: Help with modding (Java Edition)

Last seen on 21:45, 17. Dec 2022
Joined Nov 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I grab the coordinates of the block a player is looking at?

Im currently trying to add a teleport wand to my mod, but I cant seem to figure out how to grab the coordinates of the block a player is looking at.

Last seen on 20:08, 17. Apr 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You're going to have to mess…
Sun, 11/20/2022 - 23:58

You're going to have to mess around with the 'raytrace coordinates' block in the player management section- these should get you the location the player's currently targeting, though by default it just checks the block highlighted. I haven't used this much, but it seems to work pretty consistently.