Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ActionBarMessage extends JavaPlugin {
- public static void sendActionBar(Player player, String message) {
- CraftPlayer p = (CraftPlayer) player;
- IChatBaseComponent cbc = ChatSerializer.a("{\"text\": \"" + message + "\"}");
- PacketPlayOutChat ppoc = new PacketPlayOutChat(cbc, (byte) 2);
- p.getHandle().playerConnection.sendPacket(ppoc);
- }
- }
- /*
- Example of how to use the API
- ActionBarMessage.sendActionBar(ChatColor.GREEN + "It is that simple!");
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement