1
0
mirror of https://github.com/GeyserMC/Geyser.git synced 2025-12-29 03:39:22 +00:00

Introduce sendCommand API method (#5582)

* Introduce sendCommand API method

* Ensure Geyser/extension commands are caught

* Remove handleCommand from the translator, use executeCommand directly

* Relocate the command handling logic again, using the new one this time

* Fix up the javadocs

* Rename back to sendCommand, rename the packet method

* Also change the bedrock command translator

* And another one...

* Ensure we forward commands directly when catching exceptions during command execution

---------

Co-authored-by: onebeastchris <github@onechris.mozmail.com>
This commit is contained in:
Aurorawr
2025-06-25 23:21:40 +01:00
committed by GitHub
parent 0f857c69a4
commit 2ca4ea7652
7 changed files with 46 additions and 33 deletions

View File

@@ -107,6 +107,13 @@ public interface GeyserConnection extends Connection, CommandSource {
*/
void openQuickActions();
/**
* Sends a command as if the player had executed it.
*
* @param command the command without the leading forward-slash
*/
void sendCommand(String command);
/**
* @param javaId the Java entity ID to look up.
* @return a {@link GeyserEntity} if present in this connection's entity tracker.