Get a player's position by name?

Started by Adam Albu on Fri, 06/18/2021 - 07:16

Topic category: Help with modding (Java Edition)

Last seen on 14:12, 24. Jul 2021
Joined Jun 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Get a player's position by name?
Fri, 06/18/2021 - 14:35 (edited)

Hi, I'm making a QuickCommands mod and I need to get a player's coordinates by name and I can't use the execute command. I'm using Minecraft version 1.16.5 and Mccreator version 2021.1.

Edited by Adam Albu on Fri, 06/18/2021 - 14:35
Last seen on 21:29, 1. Jul 2021
Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Why can't you use the…
Wed, 06/30/2021 - 17:34

Why can't you use the execute command? That's probably the easiest solution. If you really want to do it without the execute command, there's probably some custom code you could use, but I don't know what that would be. I'll try to figure it out and report back here.

Last seen on 21:29, 1. Jul 2021
Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Actually, you could loop…
Wed, 06/30/2021 - 18:18

Actually, you could loop through all the players and select the one with the name you're looking for like this:

https://drive.google.com/file/d/1-LVannoi9qijZ39mfuJhk50-oD8HZovD/view?…

This works better than using the execute command since you actually get the player in a MCreator block, which would allow you to do more things.