Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2015
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. public class ActionBarMessage extends JavaPlugin {
  2. public static void sendActionBar(Player player, String message) {
  3. CraftPlayer p = (CraftPlayer) player;
  4. IChatBaseComponent cbc = ChatSerializer.a("{\"text\": \"" + message + "\"}");
  5. PacketPlayOutChat ppoc = new PacketPlayOutChat(cbc, (byte) 2);
  6. p.getHandle().playerConnection.sendPacket(ppoc);
  7. }
  8. }
  9.  
  10. /*
  11. Example of how to use the API
  12. ActionBarMessage.sendActionBar(ChatColor.GREEN + "It is that simple!");
  13. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement