Spigot & the ActionBar

Discussion in 'Spigot Plugin Development' started by LoonyRules, Jul 10, 2015.

  1. Recently I've switched to using the SpigotAPI jar instead of the old Spigot jar that was available. This has made some complications. I've also recently started to use Maven in my plugins, so it's so much easier for me to add dependencies.

    My question is though, how do I send an ActionBar to a player when there's no NMS in the SpigotAPI anymore?

    I used to use this code, but what's changed?
    Code (Text):
               IChatBaseComponent icbc = ChatSerializer.a("{\"text\": \"" + message + "\"}");
                PacketPlayOutChat bar = new PacketPlayOutChat(icbc, (byte) 2);
                ((CraftPlayer) p).getHandle().playerConnection.sendPacket(bar);
  2. I personally prefer to work with the whole Spigot jar as dependency but if yo don't want i think your solution is using Java Reflection ^^
  3. Really don't want to be using Java Reflection for something like this...
  4. I dont like to use Java Reflection to do this also but there isn't many ways if you want to access to the NMS using only the spigot api as a dependency. I don't know about any Spigot api to do so without using packets. (Maybe exists but I don't know about it)
  5. I never said I only wanted to use the SpigotAPI. I just don't know what I'd add in my pom.xml for NMS to work again.
  6. run BuildTools.jar on your computer. Then you can add the spigot jar as a dependency. BuildTools will install the jars it builds to your local maven repo.
  7. *facepalm*

    This forum is never fully helpful is it? I'll just wait for 12 hours for my friend to wake up so I can see how he's managed to do it without BuildTools and Java Reflection.
  8. I dont understand why you say I'm not helpful. BuildTools is the ONLY way to get you the server jar... And at the added bonus, it also automatically installs it to your local maven repo, which you state you are using maven for your plugins... Its literally that simple..