Essentials Chat / Vault

Discussion in 'Spigot Plugin Development' started by BiastGaming, May 24, 2016.

  1. Aim:
    My aim in this project is to create a EULA compliant perk to entice donations to my network. I will call it Syntax Tags. Syntax Tags is a plugin I will be working on using a command ("/tags") to open a GUI showing tags available to the player. This will all be permission based so "biast.tag.winner" would be for [Winner] suffix in chat. On clocking the tag it should either disable if the tag is enabled or enable if the tag is disabled. It will only add the tag item to the GUI if you have a permission.

    How I'm thinking:
    I am going to use a boolean for every tag so for example (boolean winnerBoolean = false;) by default. I will create the item as an item stack per tag and add to the inventory if the player has permission for the tag. I will then use ASyncChatEvent to set the message format removing or adding the suffix.

    Questions
    How would I go about implementing the chat without disforming essentials chat formatting or pex groups.
     
    #1 BiastGaming, May 24, 2016
    Last edited: May 24, 2016
  2. Wat, to get the item just use e.getItemClicked i believe.
     
  3. But does that work in a chat event?
     
  4. Your trying to get clickable chat?
     
  5. No read the post
     
  6. i read it, it dosnt makeany sense
     
  7. Updated
     
  8. Best way to do it is just store the player names and what tag they have active in a map, then you can call and change it from that using the inventory click event get item and get item name.
     
  9. You can append the prefix to the already existing format like prefix + e.getformat()
     
  10. its a tag so it has to come after the player
     
  11. I think that the best way would be to set metadata of the tag on the player so you don't have lookup times pulling from the map.
     
  12. I just used arraylists
     
  13. Event.setformat(event.getformat().replaceall("%tag%", getTag()));
    Something like that should work, just put in your essentials format that tag where you want it to be
     
  14. Also I would use a HashMap<Player, Tag(or a string)>
     
  15. Not really because I need to place something after the player name, I would like to maybe add a placeholder in essentials config but have no idea how to do it
     
  16. Well you can just add %yourplaceholder% then in the chat event use .replaceAll(%yourplaceholder%, value);