Discussion in 'Plugin Development' started by Zachary_Peculier, Jul 22, 2014.

Thread Status:
Not open for further replies.
    I need to add a command to mute certain players, and another command to silence chat except for players with a certain permission.
  2. Offline


    1. Learn java.
    2. Try to make a solution.
    3. If it doesn't work, try something else.
    4. If you tried your hardest and you're physically exhausted, come to the forums and request help.
  3. Can you not be the bigger person and help the young people and set a good example instead of leaving a [email protected]$$ response. I know plenty of java and need help with this one thing and you were no help.
  4. Offline


  5. Offline


    No need to be a jerk. That was uncalled for. We've all been a newbie at one point or another. This isn't helping in the slightest.

    Zachary_Peculier : You're gonna want to look into the events system. You can detect when players are attempting to chat, and if they're muted (this is something you'll need to control as well), you can cancel the event. If you feel like it, you can even notify the player they've been muted, if you like.

    Thats where you'll want to start looking to do something like this. If you have any questions about the events api, just ask.
  6. Zachary_Peculier
    You're kinda contradicting yourself there ;)

    As for your problem, you need to have a list that will contain the UUIDs of all the muted players. When you mute a player, first check if the list doesn't contain the designated player's UUID. If it doesn't, then add their UUID to the list. When it comes to preventing muted players from chatting, you need to listen to the AsyncPlayerChatEvent and check if your "muted list" contains the chatting player's UUID. If it does, cancel the event. Pretty simple :)
    xTigerRebornx likes this.
  7. Thank you, I will put this to work

    Thank you, I will put this to work as well.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jun 9, 2016
  8. Offline


    just try and we would help you out ..
Thread Status:
Not open for further replies.

Share This Page