Is it possible to detect a player's name from gui text inputs?

Started by Minecraftmaker12 on

Topic category: Help with modding (Java Edition)

Last seen on 02:04, 12. Oct 2024
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Is it possible to detect a player's name from gui text inputs?

I wanted to make a mod that uses a gui to send an item to a player, with the recipient username specified in a text input. However, I don't know how to detect the username from the text input. Any help?

Last seen on 02:37, 12. Oct 2024
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If your getting the entity…
Sat, 10/12/2024 - 02:37

If your getting the entity/player that the item is being sent to. Then just get the display name of said entity/player and thats their name.

Idk what you mean by text input. If your talking about the return:text when adding special information. What you can do is make a custom string data tag (playername) and set it to the players name when the item is being sent. Then in the return:text procedure use the custom string data tag to get the players name.