Skip to content

Conversation

@BaconCat1
Copy link

No description provided.

Copilot AI review requested due to automatic review settings January 13, 2026 05:23
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds support for parsing clan tags/prefixes in player names for Minecraft chat messages. The implementation extracts usernames from messages where players have clan tags or prefixes before their names (e.g., <[CLAN] PlayerName>).

Changes:

  • Modified parseUsername to extract the last token when spaces are present (clan tags typically come before usernames)
  • Added fallback logic in message parsing to handle clan tag formats like <[CLAN] username>
  • Updated removePlayerFromMsg to handle clan tags within angle brackets

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/structure/mineflayer/utils/parseUsername.ts Extracts username from strings containing clan tags by taking the last space-separated token and renamed variable from name to cleanedName
src/events/mineflayer/messagestr.ts Adds fallback parsing for clan tag format <clan username> to extract usernames and messages
src/events/mineflayer/message.ts Updates player name removal logic to handle clan tags inside angle brackets with word boundary matching

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +15 to 17
if (cleanedName.startsWith("<")) {
cleanedName = cleanedName.slice(1);
}
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check for a leading "<" character will never match because the previous line (line 12) already removes all non-word characters, underscores, and numbers. The regex [^_\w\d] removes all special characters including "<", so by the time this check runs, any "<" character would already be removed. This check should either be moved before line 12, or removed entirely if it's no longer needed.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant