Solved Actionbar usage 1.16

Discussion in 'Plugin Development' started by Minemakki, Jan 8, 2021.

  1. Offline

    Minemakki

    Is it possible to use player actionbar with Bukkit 1.16? I have been trying different apis and got none of them to work. Any help is appreciated!

    Code:
    public static void SendActionBar(Player player, String message) {
            
            // Get player uuid
            UUID uuid = player.getUniqueId();
           
            // send actionbar to player
            IChatBaseComponent barmsg = ChatSerializer.a("{\"text\": \"" + message + "\"}");
            PacketPlayOutChat bar = new PacketPlayOutChat(barmsg, ChatMessageType.GAME_INFO, uuid);
            ((CraftPlayer) player).getHandle().playerConnection.sendPacket(bar);
        }
     
    Last edited: Jan 14, 2021
  2. Offline

    JanTuck

Share This Page