Skip to content

Conversation

@roro1506HD
Copy link
Contributor

SimpleHelpMap#initializeCommands() was called twice on server startup:

  • Once at the end of CraftServer#enablePlugins(PluginLoadOrder) if the load order was POSTWORLD
  • Once near the end of MinecraftServer#initPostWorld()

Bootstrap commands being registered on server boostrap meant they were already registered on the first initializeCommands call.
JavaPlugin commands on the other hand, specifically brigadier commands registered using the LifeCycle event manager, are only registered before the second initializeCommands call.

The issue is that the HelpMap was not cleared before the second call, and the second call could not register all plugins commands because the plugin was already there, and HelpMap topics works in a way that do not allow overrides.

This PR fixes the two issues mentionned above:

  • Fixes initializeCommands being called twice on server startup
  • Fixes onEnable brigadier commands not being shown in /help <plugin> commands

Fixes #13230

@roro1506HD roro1506HD requested a review from a team as a code owner October 23, 2025 14:19
@github-project-automation github-project-automation bot moved this to Awaiting review in Paper PR Queue Oct 23, 2025
@Owen1212055
Copy link
Member

I am a bit confused how this doesnt affect when bukkit/brig commands are loaded during POST WORLD stage. How is that handled?

@roro1506HD
Copy link
Contributor Author

What are you refering to "this"? The issue or the fix?

@Owen1212055
Copy link
Member

The fix

@roro1506HD
Copy link
Contributor Author

The second initializeCommands is called after POSTWORLD plugins are initialized:

    protected void initPostWorld() {
        // ...
        this.server.enablePlugins(org.bukkit.plugin.PluginLoadOrder.POSTWORLD);
        // ...
        ((org.bukkit.craftbukkit.help.SimpleHelpMap) this.server.getHelpMap()).initializeCommands();
        // ...
    }

@lynxplay lynxplay merged commit e74d702 into PaperMC:main Nov 1, 2025
5 checks passed
@github-project-automation github-project-automation bot moved this from Awaiting review to Merged in Paper PR Queue Nov 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Merged

Development

Successfully merging this pull request may close these issues.

Help menu is incomplete when registering commands in a bootstrap context and in a plugin context

4 participants