Get a player's position by name?

Started by Adam Albu on

Topic category: Help with Minecraft modding (Java Edition)

Active 2 years ago
Joined Jun 2021
Points:
562

User statistics:

  • Modifications: 0
  • Forum topics: 2
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 6
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
Active 3 years ago
Joined Aug 2020
Points:
714

User statistics:

  • Modifications: 1
  • Forum topics: 7
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 112
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.

Active 3 years ago
Joined Aug 2020
Points:
714

User statistics:

  • Modifications: 1
  • Forum topics: 7
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 112
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.

Active 2 months ago
Joined Apr 2020
Points:
637

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 4
@willk55 Woah thanks for…
Tue, 06/07/2022 - 18:43

@willk55 Woah thanks for that, I think they should add the "name to player" feature but thats a nice fix!

Active 2 years ago
Joined Jun 2021
Points:
562

User statistics:

  • Modifications: 0
  • Forum topics: 2
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 6
Very good solution, thanks.
Mon, 09/26/2022 - 17:46

Very good solution, thanks.

Active 7 months ago
Joined Jan 2023
Points:
374

User statistics:

  • Modifications: 0
  • Forum topics: 11
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 68
Thanks guy  
Tue, 01/30/2024 - 15:53

Thanks guy

 

Active 7 months ago
Joined Jan 2023
Points:
374

User statistics:

  • Modifications: 0
  • Forum topics: 11
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 68
While i can search for the…
Tue, 01/30/2024 - 17:03

While i can search for the player with exact  name to use it in procedure, does this also work for dead players?