OK, I have been at this for some time and I still cannot get it. I cannot create functioning chat channels. It seems so easy, but I can't seem to enable them! Code: public class AsyncPlayerChat implements Listener { @EventHandler(priority=EventPriority.MONITOR) public void onChat(AsyncPlayerChatEvent e) { Player sender = e.getPlayer(); for (Player senGroup : Groups.getGroup(sender)){ } } } What would I check for after the for() loop? Code: // Mod Chat, Admin Chat, Builder Chat, GM Chat) public static List<Player> admin = new ArrayList<Player>(); public static List<Player> local = new ArrayList<Player>(); public static List<Player> builder = new ArrayList<Player>(); public static List<Player> dev = new ArrayList<Player>(); public static List<Player> mod = new ArrayList<Player>(); public static List<Player> gm = new ArrayList<Player>(); public static Groups isAdmin(Player p) { admin.contains(p); return null; } public static void isDev(Player p) { dev.contains(p); } public static List<Player> getGroup(Player p) { if (admin.contains(p)) { return admin; } if (local.contains(p)) { return local; } if (gm.contains(p)) { return gm; } if (dev.contains(p)) { return dev; } if (mod.contains(p)) { return mod; } if (builder.contains(p)) { return builder; } return null; } public static void setGroup(String name){ } How would I set the the group via permissions? I don't know if I am missing something here or what, but I need some help. Thanks in advance!
so you want the message to be sent to only certain players? What I would do is when a player sends a message, I would: Store message in a string Cancel event Check their group/permission Check for other current players with same group/permission that are online (with for loop) send message to those players.
Use bukkit's built in "broadcast" method, it's a lot easier: Code:java Bukkit.broadcast("message", "perm.to.see"); This makes all your channels permission-based.
Could you do this in code? I have an idea, just not sure. Hmmm, how would this work for multiple channels? I can't see it doing it. EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Code:java Bukkit.broadcast("message", "plugin.channels.admin");Bukkit.broadcast("message", "plugin.channels.trade"); etc... Just use a hashmap to track what channel the users are in.