Hover over player name?

Discussion in 'Spigot Plugin Development' started by JacksonHogan, May 30, 2016.

  1. I'm trying to figure out what to use to be able to hover my mouse over a player name, and see stats about them.
    Can someone point me in the right direction?
     
  2. Well, Yea i know that... Like how do i start with it?
     
  3. FG_

    FG_

    VentureChat can do that!
     
  4. You're here: Spigot Plugin Development
    DEVELOPMENT.

    sendRawMessage.
    example on one:
    Code (json (Unknown Language)):
    {"text":"%prefix%%playername%%suffix% ","color":"green","hoverEvent":{"action":"show_text","value":{"text":"","extra":[{"text":"Balance: %money%","color":"yellow"},{"text":"Rank: %rank%","color":"yellow"},{"text":"Staff: %staff_Truefalse%","color":"yellow"}]}}},{"text":">>","color":"black","bold":true},{"text":" %message%","clickEvent":{"action":"run_command","value":"/tpa %player%"},"hoverEvent":{"action":"show_text","value":{"text":"","extra":[{"text":"Click to tpa!","color":"red"}]}},"color":"none","bold":false}
     
  5. You could also use TextComponents from the Spigot API ;)
     
    • Agree Agree x 1
  6. Maybe better to make it a library, due craftbukkit?
     
  7. It's build into the Spigot API, you need to use that md5's ChatColors though.
     
  8. FG_

    FG_

    My goal is to be helpful, and by providing an option other than the redundant re-creation of something that already exists, I feel I have been helpful. You're here: SpigotMC where people HELP other server owners. HELP.
     
    • Agree Agree x 1
  9. He's a plugin developer.

    Anyways, alot of people wouldn't use another plugin as apis.
    Also, it's not even recreation when he uses a method which is there.

    He could also import https://github.com/SpigotMC/BungeeCord/tree/master/chat/src/main/java/net/md_5/bungee/api/chat as Bukkit, so that he can use that instead if he'd like.
     
  10. This section is not for server owners, it is for plugin developers.
     
  11. FG_

    FG_

    Generally the Spigot community is where both server owners and developers can help each other. In this case I was pointing to a resource that already completed this task in order to prevent him from re-creating this or perhaps using it as an example for creating his own method. Let's not further hijack this thread about this issue...

    I would use JSON formatting to achieve this - possilly using the Bungee chat API or another API. You can use JSON in conjunction with placeholders for showing ranks etc.
     
    #13 FG_, May 30, 2016
    Last edited: May 30, 2016