Hello, i recently got back into java programming and my server owner asked me to make a plugin. Which normally i would be able to code it easy do some tests and then send him a release except now he wants a chat feature almost. I'm pretty sure the solution is obvious but i couldnt find anything to help me nor could i come up with any way to do it. So heres what he wants: do a command like /abc puts you into a group where you can only chat with others who did /abc do /abc again and it puts you back into normal chat basically like how with towny you can do /tc and do a chat with people exclusively in your town. I'm not asking you to code it for me but i dont understand how i would go about doing this, would i use HashMaps? I know the chat outputs like sender.sendMessage("Sample Text"); and bukkit.broadcast("Sample Text"); So please any help is appreciated.
Don't cancel the chat events and substitute in sendMessage and broadcast. That is lazy and breaks a lot of chat plugins. Instead remove the Players from the recipient set if you don't want them to see the message. Be careful about thread safety if you are going to use the AsyncPlayerChatEvent.