How to get player coordinates

Started by Carnage on

Topic category: Help with Minecraft modding (Java Edition)

Joined Feb 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to get player coordinates
Tue, 01/21/2025 - 20:00 (edited)

Hello there,  I'm making a mod for homing missiles. i need to get coordinates of certain player and write them in 3 different variables (x y z), and then send some entity to them, how to do it? mcreator version is 2023.1

Edited by Carnage on Tue, 01/21/2025 - 20:00
Joined Sep 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
make 3 global variable…
Tue, 02/18/2025 - 17:51

make 3 global variable(preferably playerX, playerY and playerZ) then make a procedure on entity tick that checks if local entity is a player or server player, if so then it will upload it's coordinates constantly to playerX, Y and Z, then you can use them howeve you'd like  :)