Resource Action bars and such!

Discussion in 'Plugin Help/Development/Requests' started by ChipDev, Jan 31, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    ChipDev

    Hey!
    Today I reveal the awesomeness of Action bars, Not your chat, Not the sub-title, nor title, not the item name, The ACTION BAR!
    [​IMG]
    How to send:
    Code:
     public static void sendActionBar(Player p, String msg)
          {
            String s = ChatColor.translateAlternateColorCodes('&', msg);
            IChatBaseComponent icbc = ChatSerializer.a("{\"text\": \"" + s + "\"}");
            PacketPlayOutChat bar = new PacketPlayOutChat(icbc, (byte)2);
            ((CraftPlayer)p).getHandle().playerConnection.sendPacket(bar);
          }
    How it works?
    -(Byte) 2 is action bar, not chat.
    -PacketPlayOutChat is a packet that you send to a player handler by p.getHandle().
    - Q:Why did I cast ((CraftPlayer)p)? Not (CraftPlayer) p?
    -A: If I didn't, It would think that sendPacket returns a CraftPlayer.
    -Q: I get errors!! On the PacketPlayOutChat
    -A: Make sure you have the (byte) there, otherwise try removing (byte) (older versions)!

    Thanks for reading,
    Kanss.​
    My god just noticed this should be in the alternatives :p
     
    Sw_aG and mine-care like this.
  2. Offline

    mrCookieSlime

    Moved to Alternatives Section.
     
    ChipDev likes this.
  3. @ChipDev All I will say is Action bars came out a while ago.
     
  4. Offline

    mrCookieSlime

    Minecraft came out a while ago as well, yet there are still new Threads about it everyday :p
     
    xyfonix, bwfcwalshy and ChipDev like this.
  5. Offline

    ChipDev

    Ill say that no one has made a very clear (Is this clear) tutorial on it.
     
  6. Offline

    MisterErwin

    @ChipDev
    a) There are tutorials for this
    b) You might want to tell us where you got this source from...
    c) You might want to add, that you are using spigot and not another alternative...
     
Thread Status:
Not open for further replies.

Share This Page