EssentialsChat Implementing???

Discussion in 'Plugin Development' started by webbhead, Jul 16, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    webbhead

    Hello, I was wondering if there is some sort of way to hook into EssentialsChat so I can basically add a tag that any user can set at anytime so the server admin could put in the config:

    Member: "{CLANTAG} {DISPLAYNAME}: {MESSAGE}"

    So, I am basically wanting to add something so it loads the clan tag when ever just like a Faction tag.
     
  2. Offline

    artish1

    Implementing other plugins are as easy as implementing the bukkit.jar, all you need to do is just add it in as an external jar like you would with the bukkit.jar, you might also want to make your plugin depend on EssentialsChat,
    you would have to do this in the plugin.yml by adding in "depend: [EssentialsChat]" without quotations, and you might want to dig deeper in if there is a method you should call to hook into essentials on the onEnable
     
    webbhead likes this.
  3. Offline

    Onlineids

    webbhead You dont need to hook into essentials just use the .setFormat() heres a chat event where I replace {GANG} with the players gang name:
    Code:java
    1. public void onChat(AsyncPlayerChatEvent e){
    2. Player p = e.getPlayer();
    3. String gang = getGang(p);
    4. if(gang != null){
    5. String gangName = ChatColor.GRAY + "[" + ChatColor.DARK_GRAY + gang + ChatColor.GRAY + "]";
    6. String f = e.getFormat().replaceAll("\\{GANG\\}", gangName);
    7. e.setFormat(f);
    8. }else{
    9. String f = e.getFormat().replaceAll("\\{GANG\\}", "");
    10. e.setFormat(f);
    11. }
    12. }
     
    webbhead likes this.
Thread Status:
Not open for further replies.

Share This Page