So I wanted to create a GUI for a server to make stuff easier for ppl. I created a Gui with buttons for easy use so you don't have to enter commands all the time. The button works but I didn't find any function that executes a command as the player itself. I googled around but didn't find a solution for this problem.
(btw. this obviously didn't work: player.sendChatToPlayer("/{any command}");
(player is a EntityPlayer))
Regards Jens
Do a Minecraft.getMinecraft().thePlayer.sendChatMessage("/Command here")
In case you want to execute a client-side only command, you can use
ClientCommandHandler.instance.executeCommand(Minecraft.getMinecraft().thePlayer, "/your command");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With