Skip to content

Commit

Permalink
chat script event: message switch
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Apr 23, 2021
1 parent 5c4033d commit 5637059
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Expand Up @@ -38,7 +38,10 @@ public class ChatScriptEvent extends BukkitScriptEvent implements Listener {
//
// @Warning Using this will forcibly sync the chat thread.
//
// @Switch message:<matcher> to only process the event if the chat message matches an advanced matcher.
//
// @Triggers when a player chats.
//
// @Context
// <context.message> returns the player's message as an Element.
// <context.format> returns the chat message's raw format.
Expand Down Expand Up @@ -81,6 +84,9 @@ public boolean matches(ScriptPath path) {
if (!runInCheck(path, player.getLocation())) {
return false;
}
if (!runGenericSwitchCheck(path, "message", getMessage())) {
return false;
}
return super.matches(path);
}

Expand Down
Expand Up @@ -18,7 +18,7 @@ public class PotionSplashScriptEvent extends BukkitScriptEvent implements Listen
// potion splash
// <item> splashes
//
// @Regex ^on [^\s]+ splashes$
// @Regex ^on [^\s]+ splash(es)?$
//
// @Group World
//
Expand Down

0 comments on commit 5637059

Please sign in to comment.