How to get player coordinates

Started by Carnage on

Topic category: Help with Minecraft modding (Java Edition)

Active 3 months ago
Joined Feb 2024
Points:
91

User statistics:

  • Modifications: 0
  • Forum topics: 3
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 0
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
Active 1 week ago
Joined Sep 2024
Points:
120

User statistics:

  • Modifications: 3
  • Forum topics: 2
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 90
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  :)