hey guys when i went to a server and i was killing zombies i received money but the message wasn't in the chat but it was above the xp bar and every time i was killing zombies it showed me above the xp bar +10 any idea how this works?
http://wiki.vg/Protocol#Chat_Message_.28clientbound.29 "Position | Byte | 0: chat (chat box), 1: system message (chat box), 2: above hotbar"
@Nosma_Stew there's no 'API' for the protocol. TitleManager can do what you want without having to make your hands dirty with reflection. The JavaDoc can be found here
Wat? You cannot say "I will use the protocol" - Thats like saying "I will use the airplane fuel" when you fly somewhere!
don't try to say that for the likes yeah well now im searching for the position so i can take the message above the bar
hmm nice idea thanks because when a player kills a zombie the message show in the chat and this can be really spamming method
@Nosma_Stew if you want to do it yourself, this page can help: https://www.spigotmc.org/threads/actionbar-help.43909/ Code (Java): 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); } OP from that thread used a different server version in their IDE as their server, that's why it didn't work there. If you make sure you have the same version, it should work. Make sure to include CraftBukkit/Spigot Server as dependency instead of Bukkit/Spigot API. This is not version-stable, unfortunately. But since you're not so experienced with this yet, I recommend using this for now
yeah i already went there before to search as much i can to make this also thanks for the help i will try as much i can to do this ! i will set the thread as solved thought.
@Jo_Jo_2000 Something is usually called spoonfeeding when you can easily explain how to do something and some other special cases. When I'm just giving a utility method, I wouldn't call it spoonfeeding. How would you have 'explained' it?
so i just tried a code for the actionbar message and it's worked. When player is killing a zombie it adds to his bank 10 Points and now when he kills it i take this message on the action bar.