Can you run a command already in Minecraft through your plugin?

I’m trying to develop a plugin that runs a command when a command from my own plugin is executed.

For example, say I add the command /g when running, I’d like to run /give

I looked into Click Action Run Command

but that doesn’t work.

Any ideas?


I wouldn’t recommend doing so, but if you have to, here you go.

Game.getCommandDispatcher().process(game.getServer().getConsole(), “command and it’s params”);

Anyway, inventory will be implemented soon, so this will become a bad way of doing that.


Thanks a bunch! Was having trouble finding it in the JAVA DOC. Didn’t realize it was a method in the Game class.

No problem. :smile:

1 Like

You can also run the command “as the player”:

cmdService.process(player, "msg Notch hi notch!");

More info: