How do I use # instead of / for my staffchat plugin?

Discussion in 'Plugin Development' started by StarFruitYT, Sep 4, 2019.

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

    StarFruitYT

    I am trying to make a staffchat plugin as it has been something that I have been wanting to do for a while, if you need a pastebin just let me know.
     
  2. Online

    timtower Administrator Administrator Moderator

    @StarFruitYT Listen for the chat event, if the message starts with # then it is for the staff.
     
  3. Offline

    StarFruitYT

    Would i do that with AsyncPlayerChatEvent :

    I am using CommandExecutor

    https://pastebin.com/pyVpMx7q
     
  4. Online

    timtower Administrator Administrator Moderator

    @StarFruitYT That only fires for commands, which you are not using anymore.
    And I would ignore the staffchat command thing itself, just consider everything after a # to be the message.
     
  5. Offline

    StarFruitYT

    ok thank you!

    also how would i send broadcast to only the staff would i use:
    for(Player staff : Bukkit.getOnlinePlayers()){
    staff.sendMessage(msg);
    }
    or
    Bukkit.broadcast(msg, "staffchat.see");

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Sep 4, 2019
  6. Online

    timtower Administrator Administrator Moderator

    @StarFruitYT Believe both will work, but the second one won't give the ability to toggle staffchat if you want to have that.
     
  7. Offline

    StarFruitYT

    thanks again!
     
Thread Status:
Not open for further replies.

Share This Page