Skip to content

ChatMute

Namespace Mc.Scripting · Kind class (static)

public static class ChatMute

Chat mutes. The engine keeps the mute table itself (it survives plugin reloads and server restarts) and refuses a muted player’s chat lines, /say, /me and private messages before a plugin sees them, so a plugin does not check mutes on the message path. Commands and other actions are not affected. The reason is what the engine’s mute notice (chat.mute_notice) can show the player. Thread: tick thread.

Member Description
static bool Clear(Uuid player) Lifts a player’s chat mute.
static ChatMuteEntry? Get(Uuid player) The player’s active chat mute, null when the player is not muted (an expired mute is not active).
static IReadOnlyList<ChatMuteEntry> List() All active chat mutes, in profile id order: a snapshot, read from the engine in pages when this is called.
static bool Set(Uuid player, DateTimeOffset? expires, string? reason) Mutes a player’s chat.
public static bool Clear(Uuid player)

Lifts a player’s chat mute.

Parameters

Name Type Description
player Uuid The player’s profile id.

Returns bool: True when there was a mute.

public static ChatMuteEntry? Get(Uuid player)

The player’s active chat mute, null when the player is not muted (an expired mute is not active).

Parameters

Name Type Description
player Uuid The player’s profile id.

Returns ChatMuteEntry?: The mute, or null.

public static IReadOnlyList<ChatMuteEntry> List()

All active chat mutes, in profile id order: a snapshot, read from the engine in pages when this is called.

Returns IReadOnlyList<ChatMuteEntry>: The mutes.

public static bool Set(Uuid player, DateTimeOffset? expires, string? reason)

Mutes a player’s chat. A mute already in force is replaced by this one; the same mute again changes nothing.

Parameters

Name Type Description
player Uuid The player’s profile id.
expires DateTimeOffset? When the mute ends; null = forever.
reason string? The reason, at most 256 UTF-8 bytes; null or empty for none.

Returns bool: True when the table changed.

Throws

  • System.ArgumentException: The expiry is not in the future, or the reason is longer than 256 UTF-8 bytes. Nothing is changed.

ChatMuteEntry · Uuid