fix: send callback command to >= 1.21.6 clients (#1627)

This commit is contained in:
Emil
2025-08-14 18:43:20 +02:00
committed by GitHub
parent 5d450ab3c7
commit 946e5c47d4

View File

@@ -359,7 +359,12 @@ public class BackendPlaySessionHandler implements MinecraftSessionHandler {
// Inject commands from the proxy.
final CommandGraphInjector<CommandSource> injector = server.getCommandManager().getInjector();
injector.inject(rootNode, serverConn.getPlayer());
rootNode.removeChildByName("velocity:callback");
// In 1.21.6 a confirmation prompt was added when executing a command via `run_command` click
// action if the command is unknown. To prevent this prompt we have to send the command.
if (this.playerConnection.getProtocolVersion().lessThan(ProtocolVersion.MINECRAFT_1_21_6)) {
rootNode.removeChildByName("velocity:callback");
}
}
server.getEventManager().fire(