Geyser icon indicating copy to clipboard operation
Geyser copied to clipboard

Introduce sendCommand API method

Open Novampr opened this issue 6 months ago • 5 comments

Allows extensions to send commands on behalf of Geyser users

Novampr avatar Jun 06 '25 13:06 Novampr

Looks good to me. Only question I'd have - do we want to allow running internal Geyser commands (e.g. geyser achievements / geyser ping / extension commands) Om platforms such as standalone, before sending this off to the Java server?

If not, we should mark the method that it'll always send a command directly towards the Java server.

onebeastchris avatar Jun 07 '25 23:06 onebeastchris

I think adding another method with a boolean to decide whether or not it will pass through Geyser's commands would make sense, then this default method would just do that and ensure it passes through Geyser's commands, so we provide some options

default void sendCommand(String command) {
        this.sendCommand(command, true);
}

void sendCommand(String command, boolean includeGeyserCommands);

If that makes sense

Novampr avatar Jun 08 '25 15:06 Novampr

Not really a fan of adding that - it'd server no use on all platforms except standalone/viaproxy. I'd rather make that default behavior; similar how we handle command requests from the Bedrock side currently

onebeastchris avatar Jun 08 '25 15:06 onebeastchris

Makes sense, just thought if we wanted both way but yeah, lemme just update it to allow Geyser and extension commands to run too

Novampr avatar Jun 08 '25 15:06 Novampr

I guess that works...

Novampr avatar Jun 08 '25 15:06 Novampr