Skip to content

Enable /team with thread safe scoreboard teams - #519

Closed
lewisgibson wants to merge 2 commits into
PaperMC:ver/26.2.xfrom
lewisgibson:team-command
Closed

lewisgibson wants to merge 2 commits into
PaperMC:ver/26.2.xfrom
lewisgibson:team-command

Conversation

@lewisgibson

@lewisgibson lewisgibson commented Oct 1, 2026 •

Copy link
Copy Markdown

/team is disabled in the base patch because the scoreboard is shared by every region. This enables it as a feature patch: every /team subcommand runs on the global region, like /time and /weather, so team changes are applied one at a time. The team maps become concurrent and the team options volatile so that Entity#getTeam, which was stubbed to return null, can read them from any region again. A joining player is sent the existing teams from a global region task and only receives team changes after that, so each team reaches it exactly once. /scoreboard, /teammsg and the Bukkit scoreboard API stay disabled. Like /time and /weather, the command's result is not returned to the caller, so execute store on /team gets 1.

Tested on ver/26.2.x with a headless client script that counts the team packets each client receives. 9 of 9 checks pass: team add, modify and join from the console, the set_player_team packet reaching a connected client, @s[team=red] matching and @s[team=blue] not (that is Entity#getTeam), a late joiner receiving each existing team once, every one of 9 clients seeing each of 40 teams exactly once while 6 of them join, and no exception or leftover team after the console and a player hammer add, join and remove on the same teams at once. On the unpatched build the first check fails because /team is not registered.

This was done with AI (Claude Opus 5.5 and GPT Astra, high effort). I've reviewed it and tested it myself.

/team is disabled because scoreboard state is shared by all regions. Make teams thread safe and enable the team subcommands. See the patch for details.
@Dueris

Dueris commented Oct 1, 2026

Copy link
Copy Markdown

Do not spam this repository with your AI slop

@lewisgibson

lewisgibson commented Oct 1, 2026 •

Copy link
Copy Markdown
Author

Hello. Have you actually reviewed the changes? This is not slop, and I know what I'm doing. I've been working on changes for a while and intentionally broke these out so they're easier to review

@lewisgibson lewisgibson closed this Oct 2, 2026
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.

2 participants