I am trying to make a tone indicators plugin, where when people say something like '\j', it puts JOKING in their chat message
But I can't figure out how to cancel events, since I don't want the player to send the chat message and instead have the server send it with the word "JOKING" in it.
Here's my code incase needed:
usingSystem;usingMCGalaxy;usingMCGalaxy.Events.ServerEvents;usingMCGalaxy.Events.PlayerEvents;namespacePluginToneIndicators{public sealed classToneIndicators:Plugin{public override string name { get {return"ToneIndicators";}}public override string MCGalaxy_Version{ get {return"0.1";}}public override string creator { get {return"AllergenX";}}public override voidLoad(bool startup){OnPlayerChatEvent.Register(HandlePlayerChat,Priority.High);}public override voidUnload(bool shutdown){OnPlayerChatEvent.Unregister(HandlePlayerChat);}staticvoidHandlePlayerChat(Player p, string message){if(message.Contains("\\j")==true){// Cancel the event somehow// Ignore the rest of the code from this commentChat.Message(ChatScope.Global,"&aJOKING", null, null,true);}}}}
I am trying to make a tone indicators plugin, where when people say something like '\j', it puts JOKING in their chat message
But I can't figure out how to cancel events, since I don't want the player to send the chat message and instead have the server send it with the word "JOKING" in it.
Here's my code incase needed:
Share this post
Link to post