Hi guys, I am programming a plugin for BungeeCord and i want that a method is execute if someone is clicking on the Chat. I allready searched on the internet, but i only fined, how i would do it in Bukkit. So my question is how can i do it on BungeeCord. Yours faithfully, Simonsator
@Teg I think its the only way, isn't it? Here an easy to use Lib for Json messages: https://github.com/mkremins/fanciful
For all who don´t want to read the hole github project: Code (Text): String whatShouldBeWrittenIntoTheChat = "Something"; String command = "/something"; String hoverMessage="Click here to do something"; jsoncode = "{'text':'" + whatShouldBeWrittenIntoTheChat + "', 'clickEvent':{'action':'run_command','value':'" + command + "'},'hoverEvent':{'action':'show_text','value':'"+hoverMessage+"'}}"; player.unsafe().sendPacket(new Chat(jsoncode)); Of course you don´t need to make it with defining firstly all variables you can directly write it into player.unsafe().sendPacket(new Chat())
This is in the bungee section, why not use the bungee chat API rather than adding an extra dependency?