
HrdaAPI is a powerful core library (core plugin) that powers features in my other projects. Currently, it serves as the main and required dependency for the HrdaNick plugin.
Thanks to the internal integration of PacketEvents, it can safely and reliably listen to and modify network packets. It primarily focuses on modifying PLAYER_INFO_UPDATE packets, which allows for instant name (nametag) changes directly above the player's head without requiring any client-side mods.
⚙️ For Server Owners
If you want to use my HrdaNick plugin on your server (which recently surpassed an amazing milestone of 2,000 downloads!), you must have HrdaAPI installed.
- Download the latest version of HrdaAPI.
- Download the latest version of PacketEvents
- Place the downloaded
.jarfiles into thepluginsfolder on your server. - Restart your server.
💻 For Developers (API)
If you are creating your own plugins and want to use my stable system for changing nicknames and nametags, HrdaAPI offers very simple static methods via the HrdaNickAPI class.
Upon any change, the API automatically takes care of packet re-encoding and an invisible player "refresh" (hiding and showing the player again) so that the new nametag loads correctly and instantly for everyone around.
Usage examples:
import cz.hrda.hrdaAPI.api.HrdaNickAPI;
import org.bukkit.entity.Player;
// Setting a new nickname for a player (including the nametag above their head)
HrdaNickAPI.setNick(player, "NewNick");
// Getting the currently spoofed nickname
String nick = HrdaNickAPI.getNick(player);
// Checking if the player currently has a modified nickname
boolean hasNick = HrdaNickAPI.hasNick(player);
// Safely removing the custom nickname and reverting to the original name
HrdaNickAPI.resetNick(player);
// Manually forcing a nametag refresh for surrounding players
HrdaNickAPI.refreshPlayer(player);

