-
Notifications
You must be signed in to change notification settings - Fork 8
Actions
mcwrapper
's primary calling method is via actions. Basic usage is as follows:
mcwrapper <action> [ <action_arguments> ]
Also aliased as --help
, -h
, and -?
.
Prints the help screen which includes information about all the built-in commands. Calling
mcwrapper
without any arguments does the same thing.
Also aliased as --version
.
Prints the version of mcwrapper
.
Prints information about the program and the author and where to get additional information.
Starts the Minecraft server if it has not already been started and return to the prompt immediately. Returns a zero status on success and non-zero if an error occurs. The Minecraft server process is run in the background as the current user.
See the status
command for documentation on how to tell if Minecraft is already running.
Stops the Minecraft server if it's running.
Restarts the Minecraft server by stopping it, then starting it again.
Checks whether the Minecraft server is running. Returns a zero status code if it's running, and a non-zero if it's not running.
Does a sanity check and ensures that mcwrapper
is configured properly. If the
minecraft_server.jar
isn't found or some other configuration parameter is improperly
set, it will let you know.
check
will return a zero status if everything is ok or a non-zero in the result of an error.
Used to install the Minecraft server from minecraft.net. It will install to the location defined
by the configuration. If MINECRAFT_SERVER_PATH
is not set, it defaults to the current
directory.
Update the currently installed minecraft_server.jar
. If the server is currently running,
mcwrapper
will stop it, install the new version, renaming the current version to
minecraft_server.jar.old
and start the new server up.
Tail the Minecraft server log in real-time. Press ^C to stop it.
Backup your world data safely without interruption to anyone connected to the server.
What backup
does is disable world-data writing, copy and compress the current world data
to the backup directory, then re-enables world-data writing.
Restore world data from a previous backup. This cannot be done without interruption to the
users, so when running restore
, any connected clients will be disconnected.
Copy the example configuration to the current directory (./mcwrapper.conf
). The example config is based on the built-in defaults in mcwrapper
.
The config
action is used for fetching configuration options for mcwrapper
. All results
are printed to STDOUT and are designed for use with external scripts.
Usage:
mcwrapper config <param>
The following are config
parameters that can be read:
The value of the MINECRAFT_SERVER_PATH
configuration parameter. This is the path to the
minecraft_server.jar
.
The value of the MINECRAFT_SERVER_DIR
configuration parameter. This is the path to the
directory that contains minecraft_server.jar
.
The path to the .pid file for mcwrapper
.
The pid for the currently running minecraft_server.jar
instance. If it's not running, it will
return an error with a non-zero status. If the Minecraft server is killed or terminates for any reason,
mcwrapper
will automatically terminate itself, so it's safe to kill that process and everything will
exit cleanly.
The path to the command_input
FIFO.
The command that will be used to launch the Minecraft Server.
The path to the directory for world backups.
The path to the latest backup.
The number of backups to retain after doing a backup.
Used to read properties from the server.properties
file that is used by the Minecraft
server. This is a convenience action to simplify reading configuration parameters by
external scripts.
Usage:
mcwrapper prop <prop_name>
Example to read the TCP port that the server is running on:
mcwrapper prop server-port
Aliased as cmd
.
Used for running commands on the minecraft server. This can be used to send chat messages to players, give players inventory items or kick players.
Example to send a chat message:
mcwrapper cmd say hi everybody