Pumpkin-MC/Pumpkin · error · ChatError

sent a message with illegal characters

Error message

sent a message with illegal characters

What it means

Sentinel variant of ChatError raised when an inbound Java chat/signature packet contains characters the server considers illegal (section signs, control characters outside formatting rules). It is a validation guard over player-supplied chat text at packet-decode time; the offending input is the chat message body itself. The client is normally kicked with this reason.

Solutions

  1. Kick the player with an invalid-chat reason
  2. Sanitize or reject messages containing illegal characters
  3. Log the violation at warn level
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/pumpkin/src/net/java/play/mod.rs:128 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Pumpkin-MC/Pumpkin@8d4639e25a (2026-09-09). Data as JSON: /api/errors/3ec4112e83a57006. Report an issue: GitHub.

Appendix: source

Thrown at crates/pumpkin/src/net/java/play/mod.rs:128

            Self::BlockOutOfWorld | Self::InvalidGamemode => Level::TRACE,
            Self::BlockOutOfReach | Self::InvalidBlockFace | Self::InvalidHand => Level::WARN,
        }
    }

    fn client_kick_reason(&self) -> Option<String> {
        match self {
            Self::BlockOutOfReach | Self::BlockOutOfWorld | Self::InvalidGamemode => None,
            Self::InvalidBlockFace => Some("Invalid block face".into()),
            Self::InvalidHand => Some("Invalid hand".into()),
        }
    }
}

#[derive(Debug, Error)]
pub enum ChatError {
    #[error("sent an oversized message")]
    OversizedMessage,
    #[error("sent a message with illegal characters")]
    IllegalCharacters,
    #[error("sent a chat with invalid/no signature")]
    UnsignedChat,
    #[error("has too many unacknowledged chats queued")]
    TooManyPendingChats,
    #[error("sent a chat that couldn't be validated")]
    ChatValidationFailed,
    #[error("sent a chat with an out of order timestamp")]
    OutOfOrderChat,
    #[error("has an expired public key")]
    ExpiredPublicKey,
    #[error("attempted to initialize a session with an invalid public key")]
    InvalidPublicKey,
}

impl PumpkinError for ChatError {
    fn is_kick(&self) -> bool {
        true

View on GitHub (pinned to 8d4639e25a)