I am trying to modify player names on the tab list. I want this to be client side only. More specificaly, I would like the current player's name to be changed to whatever I want. I have tried many things but none have worked. I need this for 1.8.9.
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onRenderGameOverlay(RenderGameOverlayEvent.Pre event) {
if (Minecraft.getMinecraft().thePlayer == null || Minecraft.getMinecraft().theWorld == null || event.type != RenderGameOverlayEvent.ElementType.PLAYER_LIST) {
return;
}
event.setCanceled(true);
renderTabList(event.resolution.getScaledWidth());
}
public void renderTabList(int width) {
Scoreboard scoreboard = Minecraft.getMinecraft().thePlayer.worldObj.getScoreboard();
Minecraft.getMinecraft().ingameGUI.getTabList().renderPlayerlist(width, scoreboard, scoreboard.getObjectiveInDisplaySlot(0));
}
I started writing this, which was copied from a scoreboard resize mod. I don't know if this is the right track.
@SubscribeEvent(priority = EventPriority.NORMAL)
public void onRenderGameOverlay(NameFormat event) {
event.displayname = "test";
Minecraft.getMinecraft().thePlayer.refreshDisplayName();
}
I also tried this but realised it was only on multiplayer.
Thank you in advance.