setEnabled
Enables or disables the chat for the server.
Commands
This will disable the chat for all players, including admins. If you want to disable the chat for a specific player, use the player.setChatEnabled
method instead.
If you're using engine.setForwardMessages
to forward messages to a WebSocketServer
, this will method will have no effect.
PERSISTENT METHOD
This method is persistent. It will not reset when a server restarts.
Syntax
engine.chat.setEnabled(enabled);
Parameters
Name | Type | Description |
---|---|---|
enabled | boolean | Whether the chat should be enabled or not. |
Example
engine.chat.setEnabled(false);
Available on: Client Server