Chat help

Discussion in 'Plugin Development' started by TekxWolf, May 25, 2015.

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


    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:
    1. do a command like /abc
    2. puts you into a group where you can only chat with others who did /abc
    3. 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.
  2. Offline


    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.
    nverdier likes this.
Thread Status:
Not open for further replies.

Share This Page