View on GitHub

Pocketmine ctrl

Control script for PocketMine.

Download this project as a .zip file Download this project as a tar.gz file


Script to manage PocketMine server on linux.



Install with PocketMine

su - pocketmine
#. install PocketMine-MP
mkdir -p ~/pocketmine
cd ~/pocketmine
pmmp_version=$(curl -s \ |\
grep -i name | head -n1 | cut -d':' -f2 |\
sed -e 's/"//g' -e 's/,$//g' -e 's/^ //g')
curl -L$ | bash
#. install PocketMine Ctrl
cd ~
git clone
ln -s ~/PocketMine_Ctrl/ ~/pocketmine/


su - pocketmine
cd  ~/PocketMine_Ctrl/
git pull




Control script for PocketMine server.

Usage: [CMD]

Available CMDs:
  start                 Start PocketMine server.
  attach                Attach PocketMine server console.
  console               Alias for attach.
  stop                  Stop PocketMine server. (graceful)
  restart               Restart PocketMine server. (graceful)
  kill                  Kill the PocketMine server.
  cmd "MY COMMAND"      Send command to PocketMine server.
  plainlog "LOGFILE"    Strip color code from log file.
  log-rotate            Log rotate.
  remake-world          Regenerate worlds and keep old worlds. (need restart)
  purge-world           Regenerate worlds. (need restart)

Daily Jobs

Add settings to /etc/crontab like below.

# m h dom mon dow user  command
59 23   * * *   pocketmine /home/pocketmine/pocketmine/ log-rotate
51 0    * * *   pocketmine /home/pocketmine/pocketmine/ cmd "say Server will restart in 10 minute."
56 0    * * *   pocketmine /home/pocketmine/pocketmine/ cmd "say Server will restart in 5 minute."
0  1    * * *   pocketmine /home/pocketmine/pocketmine/ cmd "say Server will restart in 1 minute."
1  1    * * *   pocketmine /home/pocketmine/pocketmine/ restart



How do I detach the console?

Press Ctrl+a, then press d.

Why do I see lots of "iamjustaspam" in the console or "Command doesn't exist!" in the console.log?

I need to clear the console input while use the 'cmd' function, but PocketMine can't handle the Ctrl+b,Ctrl+e or UP/Down/LEFT/RIGHT keys right now, so sending a spam instead, it will be fixed in the future.

I can't understand what you say!

Because the English is't my native language, sorry :(


Timothy.Lee a.k.a MarlboroMoo.


Released under the MIT License.