Skip to content

Commit

Permalink
Allow running client commands from chat components (neoforged#554)
Browse files Browse the repository at this point in the history
  • Loading branch information
SquidDev authored and Soaryn committed Jan 21, 2025
1 parent e4be1e4 commit be68be9
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,15 @@
SignableCommand<SharedSuggestionProvider> signablecommand = SignableCommand.of(this.parseCommand(p_250092_));
if (signablecommand.arguments().isEmpty()) {
this.send(new ServerboundChatCommandPacket(p_250092_));
@@ -2565,6 +_,8 @@
}

public boolean sendUnsignedCommand(String p_251509_) {
+ // Neo: Dispatch client commands for text component click actions.
+ if (net.neoforged.neoforge.client.ClientCommandHandler.runCommand(p_251509_)) return true;
if (!SignableCommand.hasSignableArguments(this.parseCommand(p_251509_))) {
this.send(new ServerboundChatCommandPacket(p_251509_));
return true;
@@ -2640,6 +_,10 @@

public Scoreboard scoreboard() {
Expand Down

0 comments on commit be68be9

Please sign in to comment.