Search code examples
pythonlinuxserverminecraftbukkit

Minecraft Server Executing Scripts


I am working on a minecraft world space that can interact with a terminal shell and run commands on the computer directly. I intend to use not just the vanilla server but maybe craftbukkit or spigot.

Is it possible to create a listener on minecraft server.jar and wait for a certain command which executes a script on the computer itself?

Is there a plugin out there made for this purpose?


Solution

  • You can create a new plugin for Bukkit/Spigot (more information here).

    In the onCommand-Method you can then call Runtime.getRuntime().exec("your shell command") to run commands in the linux shell (can also be used on Windows servers).

    See also the Java documentation.