Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hey,

I started coding with forge some days ago and now I'm wondering how I can change the name of the Client on the Clientside?

So everyone can see the real name of the player but he just sees for example "Notch" and not "MisterQuatsch".

I know that need to change it in the Tablist, Chat, Scoreboard and maybe when his name is on Items, Tablist and so on.

So is it possible and when yes how?

 

Thanks for any help :D

 

~MisterQuatsch

PlayerEvent.NameFormat

is fired when a player's display name is retrieved for the first time (or refreshed by calling

EntityPlayer#refreshDisplayName

). You can use this to change the player's display name.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

But would this also be a possible with just the Vanilla MCP?

No, not in a good way.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

  • Author

Ok I found it out and if anyone ever need this here is how you can do it.

1. Go into net.minecraft.client.gui.FontRenderer.java

2. Find this function "func_175065_a" or the "drawString" function.

3. Add this code before the "GlStateManager.enableAlpha();"

if ((Minecraft.getMinecraft().getNetHandler() != null) && (SomeThing == true))
        {
        if (p_175065_1_.contains(Minecraft.getMinecraft().session.getUsername())) {
          p_175065_1_ =  p_175065_1_.replace(Minecraft.getMinecraft().session.getUsername(), "NewDisplayNameForTheClient");
        }
      }

4. Incase you have a empty name or nothing is in the Chat when you write something add this below:

		
if (p_175065_1_.contains(Minecraft.getMinecraft().session.getUsername())) {
p_175065_1_ = p_175065_1_.replace(Minecraft.getMinecraft().session.getUsername(), Minecraft.getMinecraft().session.getUsername());
}

5. So the complete Code would be:

if ((Minecraft.getMinecraft().getNetHandler() != null) && (SomeThing == true))
        {
        if (p_175065_1_.contains(Minecraft.getMinecraft().session.getUsername())) {
          p_175065_1_ =  p_175065_1_.replace(Minecraft.getMinecraft().session.getUsername(), "NewDisplayNameForTheClient");
        }
      }
if (p_175065_1_.contains(Minecraft.getMinecraft().session.getUsername())) {
p_175065_1_ = p_175065_1_.replace(Minecraft.getMinecraft().session.getUsername(), Minecraft.getMinecraft().session.getUsername());
}

 

~ MisterQuatsch

Editing base-classes is not supported. Use the

PlayerEvent.NameFormat

event.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Guest
This topic is now closed to further replies.

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.