Getting player username for gui

Started by ModdingMiner on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jan 2026
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Getting player username for gui

So I'm trying to create a mod where there are computers and I'm trying to make to classic login screen for Windows 11 when you don't have a password, it shows your name and and a login button, I'm trying to do that in my mod, that's the thing I'm trying to do but I'm having trouble getting the username of the player and showing it on the GUI, can somebody please help me?

Joined Aug 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
To get the username or…
Fri, 01/02/2026 - 05:30

To get the username or minecraft name of the player and show it as text in your gui do these steps.

  1. create a label
  2. at the place you write the text you will see a dropdown that says "fixed"
  3. to make the text say the players username you will need to make a procedure
  4. create a new procedure and name it something like "LabelTextValue" (name doesn't matter)
  5. get the "return text" block from the flow control section
  6. get the "get display name of entity" from the entity data section
  7. save the procedure
  8. go back to the gui and click the dropdown that says "fixed" again
  9. you will see the procedure you created
  10. click on it and save the label
  11. Now you have a label that gets the username of the player!