A node module meant to manage a minecraft server instance
An API for running minecraft server instances. It also monitors the server for
particular events and emits them in ways that you can use in your application.
For example, it will emit a
joined event when a player joins the server.
npm install minecraft-runner
Include in your project, the export is a single constructor function
var Game = require"minecraft-runner";
The constructor will create an object representing a file on disk.
var game = "/path/to/server" "/path/to/jar";
Startup the server instance. The callback is executed once the server reports it has finished starting.
gamestart// err => null or Error()// proc => spawned process object, same as this.process;
Stops the server instance. The callback is executed once the process exits. (ie: when the server finishes shutting down)
gamestop// err => null or Error();
Restarts the server instance. (ie. calls
start() in succession)
gamerestart// err => null or Error()// proc => spawned process object, same as this.process;
Issues a command to the server. All the arguments to the function are joined with a space.
// broadcast "Hello World" to all players on the servergamecommand"say" "Hello World";// say "Hello" to only player testusergamecommand"tell" "testuser" "Hello";