Render Name Icons
This lets you add icons or text to player nametags, which will show up in both tablist & nametags depending on how you limit it.
Bug
If you are using Lunar Client nametag icons will only be displayed in tablist.
Interface
Overrides
Info
These methods will return no text by default, that means you can skip overriding if you have no intentions of modifying it.
String, used for setting prefix (what comes before) the player name.
String, used for setting suffix (what comes after) the player name.
Registering
You will need to register your implementation at init.
Example
/*
This displays a prefix and suffix for yourself that says if it is currently being rendered in tablist or nametag.
*/
public class ExampleIcon implements IconProvider {
@Override
public String getPrefix(GameProfile profile, boolean tablist, boolean nametag) {
if (profile.getId() != Minecraft.getMinecraft().thePlayer.getUniqueID()) return "";
if (tablist) {
return "Tablist ";
}
return "Nametag ";
}
@Override
public String getSuffix(GameProfile profile, boolean tablist, boolean nametag) {
if (profile.getId() != Minecraft.getMinecraft().thePlayer.getUniqueID()) return "";
if (tablist) {
return " Tablist";
}
return " Nametag";
}
}