How to hide chat channels from other people?

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

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

    Msrules123

    So, I am currently making a plugin where you can change your chat channels by doing /chat. I have this code already set-up.

    This is my problem: I can't figure out how to hide the channels from players who I don't want to see them. EX: The admin chat shouldn't be seen by normal players.

    If anyone could help me figure this out, help would be gradually appreciated. I will post the code for this soon, but for the meantime the plugin is called by "plugin.chat".
     
  2. Offline

    The Fancy Whale

    Garris0n likes this.
  3. Offline

    ZironCodes

    Add the players you dont want to recieve the message to a List<String> and then loop through the players like this..

    Code:java
    1. for (Player player : listName.getContents()) {
    2. for (Player players : Bukkit.getOnlinePlayers()) {
    3. if (player != players) {
    4. player.sendMessage("Message");
    5. }
    6. }
    7. }


    Message me back if this doesn't work. Just threw this together on the spot right now. Hope this helps though.
     
Thread Status:
Not open for further replies.

Share This Page