Add event for commands and make __on_player_message not trigger for them (#1525)

* Restoring old behaviour of __on_player_message

Fixes #1511

* Changed to PLAYER_COMMAND

* Updated docs

* Updated event_test.sc

* Updated editor keywords

* Fixed issue
This commit is contained in:
Ghoulboy authored and GitHub committed 2022-12-26 15:30:50 +01:00
1 parent b63dfa1b0a
commit 43bb84437f
6 files changed
+32 -2

No files matched your search

+4 -1
View File
@@ -316,7 +316,10 @@ Triggered when the player has successfully logged in and was placed in the game.
Triggered when a player sends a disconnect package or is forcefully disconnected from the server.
### `__on_player_message(player, message)`
Triggered when a player sends a chat message or runs a command.
Triggered when a player sends a chat message.
### `__on_player_command(player, command)`
Triggered when a player runs a command. Command value is returned without the / in front.
This event can be cancelled by returning `'cancel'`, which prevents the message from being sent.