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'm trying to make a mod that modifies the tablist to change the player's name there to something they have chosen from a command. I'm fairly new to forge modding so I honestly have no clue how to do this.

 

From what I've gathered I will need to use the GuiPlayerTabOverlay class. My only thoughts would be reflection (however I believe this is not the proper solution), can anybody help me with this?

 

Thanks -boomboompower

Hey, i'm trying to make a mod that modifies the tablist to change the player's name there to something they have chosen from a command. I'm fairly new to forge modding so I honestly have no clue how to do this.

 

From what I've gathered I will need to use the GuiPlayerTabOverlay class. My only thoughts would be reflection (however I believe this is not the proper solution), can anybody help me with this?

 

Thanks -boomboompower

Are you wanting to change the whole name or just add prefixes/suffixes?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

  • Author

Hey, i'm trying to make a mod that modifies the tablist to change the player's name there to something they have chosen from a command. I'm fairly new to forge modding so I honestly have no clue how to do this.

 

From what I've gathered I will need to use the GuiPlayerTabOverlay class. My only thoughts would be reflection (however I believe this is not the proper solution), can anybody help me with this?

 

Thanks -boomboompower

Are you wanting to change the whole name or just add prefixes/suffixes?

 

I want to change the whole name, think of it as a client-side nickname mod

  • Author

PlayerEvent.NameFormat

.

 

So like

@SubscribeEvent(priority = EventPriority.LOWEST)
public void onPlayerEvent(PlayerEvent.NameFormat event) {
    event.displayname = "Nickname";
}

  • Author

Something like that, yes. I suggest you read the Javadocs for the event, there is an important thing to note.

NameFormat is fired when a player's display name is retrieved.
This event is fired whenever a player's name is retrieved in EntityPlayer#getDisplayName() or EntityPlayer#refreshDisplayName().

This event is fired via the ForgeEventFactory#getPlayerDisplayName(EntityPlayer, String).

username contains the username of the player. displayname contains the display name of the player. 
This event is not Cancelable. 
This event does not have a result. HasResult 
This event is fired on the MinecraftForge#EVENT_BUS.

 

Tested my code above, kinda breaks the mod functionality. What way (personally) would you usually modify the playerlist?

Something like that, yes. I suggest you read the Javadocs for the event, there is an important thing to note.

NameFormat is fired when a player's display name is retrieved.
This event is fired whenever a player's name is retrieved in EntityPlayer#getDisplayName() or EntityPlayer#refreshDisplayName().

This event is fired via the ForgeEventFactory#getPlayerDisplayName(EntityPlayer, String).

username contains the username of the player. displayname contains the display name of the player. 
This event is not Cancelable. 
This event does not have a result. HasResult 
This event is fired on the MinecraftForge#EVENT_BUS.

 

Tested my code above, kinda breaks the mod functionality. What way (personally) would you usually modify the playerlist?

What do you mean it breaks the mods functionality?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

  • Author

Something like that, yes. I suggest you read the Javadocs for the event, there is an important thing to note.

NameFormat is fired when a player's display name is retrieved.
This event is fired whenever a player's name is retrieved in EntityPlayer#getDisplayName() or EntityPlayer#refreshDisplayName().

This event is fired via the ForgeEventFactory#getPlayerDisplayName(EntityPlayer, String).

username contains the username of the player. displayname contains the display name of the player. 
This event is not Cancelable. 
This event does not have a result. HasResult 
This event is fired on the MinecraftForge#EVENT_BUS.

 

Tested my code above, kinda breaks the mod functionality. What way (personally) would you usually modify the playerlist?

What do you mean it breaks the mods functionality?

 

The nickname for chat is simple replacing the name with their desired nickname. When using the NameFormat event, it has already set the name so it doesn't replace it, also after running the command it doesn't change the name.

Make a map that takes their username to their display name. Then whenever the command is ran change the nickname in the Map. Save the map to the disk, either yourself using a txt, using the forge config, or even to the World using WorldSaveData or even a World Capability. And I didn't understand the first problem...

The nickname for chat is simple replacing the name with their desired nickname. When using the NameFormat event, it has already set the name so it doesn't replace it...

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

  • Author

Make a map that takes their username to their display name. Then whenever the command is ran change the nickname in the Map. Save the map to the disk, either yourself using a txt, using the forge config, or even to the World using WorldSaveData or even a World Capability. And I didn't understand the first problem...

The nickname for chat is simple replacing the name with their desired nickname. When using the NameFormat event, it has already set the name so it doesn't replace it...

The idea behind the mod is for YouTuber's to nickname themselves on servers (when they are on alts) so they can record without targeting.

 

So I have a question, what will happen if I run this on a server whilst I am playing on a server? I doubt that it will change my display name on the server.

 

This is why I wish to avoid this method and just be shown to a Collection or something where the playerlist is stored.

 

 

Make a map that takes their username to their display name. Then whenever the command is ran change the nickname in the Map. Save the map to the disk, either yourself using a txt, using the forge config, or even to the World using WorldSaveData or even a World Capability. And I didn't understand the first problem...

The nickname for chat is simple replacing the name with their desired nickname. When using the NameFormat event, it has already set the name so it doesn't replace it...

The idea behind the mod is for YouTuber's to nickname themselves on servers (when they are on alts) so they can record without targeting.

 

So I have a question, what will happen if I run this on a server whilst I am playing on a server? I doubt that it will change my display name on the server.

 

This is why I wish to avoid this method and just be shown to a Collection or something where the playerlist is stored.

If the mod is on the server and you run the command it will indeed change your name. But if it is not on the server and you have it and run it, it will not change your name to others, why? Because other players do not have the information. This may be done only server side, but i do not know if that would work.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

  • Author

Make a map that takes their username to their display name. Then whenever the command is ran change the nickname in the Map. Save the map to the disk, either yourself using a txt, using the forge config, or even to the World using WorldSaveData or even a World Capability. And I didn't understand the first problem...

The nickname for chat is simple replacing the name with their desired nickname. When using the NameFormat event, it has already set the name so it doesn't replace it...

The idea behind the mod is for YouTuber's to nickname themselves on servers (when they are on alts) so they can record without targeting.

 

So I have a question, what will happen if I run this on a server whilst I am playing on a server? I doubt that it will change my display name on the server.

 

This is why I wish to avoid this method and just be shown to a Collection or something where the playerlist is stored.

If the mod is on the server and you run the command it will indeed change your name. But if it is not on the server and you have it and run it, it will not change your name to others, why? Because other players do not have the information. This may be done only server side, but i do not know if that would work.

I know. All I need is a variable or something that the client has that stores the playerlist. This mod is not meant to be installed on a server. That's why I don't want to use that method
This mod is not meant to be installed on a server.

 

Then you can't do what you want to do.  Game, set, match.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author

This mod is not meant to be installed on a server.

 

Then you can't do what you want to do.  Game, set, match.

Alright then. Lock.

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.