PocketMine说明文档¶
介绍¶
PocketMine-MP是一种Minecraft PE的服务器软件。 这有一个插件API允许开发者扩展它并添加新特性或更改默认特性。
支持的功能¶
- 把你所有的朋友都放在一台服务器上。或者运行一个公共服务器。
- 禁用飞行,项目攻击,运行和放大器;更多。有一个开/关开关。
- 以你想要的方式扩展游戏,添加了不起的功能。
- 传送玩家,白名单您的服务器,调优服务器,远程控制台。
- 一次加载不同的级别,然后来回传送。
- 无尽的功能,我们不断地实现新事物。
联系与支持¶
- PocketMine论坛
- #pocketmine 求助 @ chat.freenode.net
要求¶
支持MCPE版本¶
检查当前PocketMine-MP支持的协议版本,在PocketMine-MP中运行 version
指令。
运行 version
指令输出:
This server is running PocketMine-MP 1.6.2dev 「Unleashed」
implementing API version 3.0.0-ALPHA5
for Minecraft: PE v1.0.7.0 (protocol version 107)
服务器报告的游戏版本是最低支持版本。新的补丁版本的游戏有时与旧版本兼容,所以在要求更新版本之前,先尝试看看是否可以先连接到当前的服务器。 如果没有在此列出版本,则通常意味着在列出的版本之间没有协议更改,所以在您的版本之前查看最新的条目。
Minecraft 版本 | 协议版本 |
---|---|
v1.1.0.55 | 113 |
v1.1.0.9 | 112 |
v1.1.0.8 | 111 |
v1.1.0.0 | 110 |
v1.0.7.0 | 107 |
v1.0.6.0 | 106 |
v1.0.5.0 | 105 |
v1.0.4.1 | 102 |
v1.0.3.0 | 101 |
v1.0.0.0 | 100 |
v0.17.0.2 | 92 |
v0.16.0.5 | 91 |
v0.15.90.1 | 90 |
v0.15.10.0 | 84 |
v0.15.9.0 | 83 |
v0.15.4.0 | 82 |
v0.15.0.0 | 81 |
v0.14.3.0 | 70 |
v0.14.2.0 | 60 |
v0.14.0.7 | 45 |
v0.14.0.6 | 44 |
v0.14.0.5 | 43 |
v0.14.0.4 | 43 |
v0.14.0.3 | 42 |
v0.14.0.1 | 41 |
v0.13.2.0 | 39 |
v0.13.0.4 | 38 |
v0.13.0.3 | 38 |
v0.13.0.2 | 37 |
v0.13.0.1 | 37 |
v0.11.0.14 | 27 |
v0.11.0.11 | 26 |
v0.11.0.8 | 25 |
v0.11.0.7 | 24 |
v0.11.0.5 | 23 |
v0.11.0.4 | 22 |
v0.11.0.1 | 21 |
v0.10.0.6 | 20 |
v0.10.0.1 | 19 |
v0.9.5.0 | 18 |
v0.9.0.12 | 17 |
v0.9.0.7 | 16 |
v0.9.0.2 | 15 |
v0.8.1.0 | 14 |
v0.7.4.0 | 12 |
v0.7.0.0 | 11 |
v0.6.1.0 | 9 |
v0.6.0.0 | 9 |
v0.5.0.0 | 8 |
v0.4.0.0 | 7 |
v0.3.3.0 | 6 |
v0.3.2.0 | 5 |
v0.3.0.0 | 4 |
v0.2.2.0 | 3 |
v0.2.1.0 | 3 |
v0.2.0.0 | 2 |
v0.1.3.0 | |
v0.1.2.0 | |
v0.1.1.0 | |
v0.1.0.0 |
安装¶
Using https://get.pmmp.io (Linux/MacOS only)¶
警告
仅限在inux或MacOS上运行。
Create a directory which you want to install PocketMine-MP into, and cd
into it.
Then use curl
or wget
to install PocketMine-MP using the following command:
curl -sL https://get.pmmp.io | bash -s -
wget -q -O - https://get.pmmp.io | bash -s -
[*] Found PocketMine-MP Final_1.5dev (build 1254) using API 1.12.0
[*] This development build was released on Sat Jun 20 09:45:04 CEST 2015
[*] Installing/updating PocketMine-MP on directory ./
[1/3] Cleaning...
[2/3] Downloading PocketMine-MP Final_1.5dev-1254 phar... done!
[3/3] Obtaining PHP: detecting if build is available...
[3/3] MacOS 64-bit PHP build available, downloading PHP_5.6.10_x86-64_MacOS.tar.gz... checking... regenerating php.ini... done
[*] Everything done! Run ./start.sh to start PocketMine-MP
Error
It is recommended to run it as a normal user as it doesn’t need further permissions.
Do not run the installer as root, this is discouraged.
Installing manually¶
No installer available for your platform? Did the installer fail? It is not your taste? YOLO? DIY!
Getting PHP for your server¶
Getting PocketMine-MP¶
Using .phar¶
- Create a new directory for PocketMine-MP.
- Download PocketMine-MP.phar (Downloads)
- Rename the .phar to
PocketMine-MP.phar
. - Place it in the PocketMine-MP directory you just created.
- Get the start script for your platform (Windows CMD, Windows PowerShell, Linux/MacOS bash)
- (Linux/MacOS only) Make start.sh executable (chmod +x start.sh)
Using Git¶
您还可以使用Git克隆GitHub库,从而从源代码运行PocketMine-MP
PocketMine-MP使用Composer来管理其库依赖项。Composer是用我们预先构建的PHP包发布的,但是如果您想手动安装它,您可以这样做https://getcomposer.org.
复制存储库(递归地,包括子模块):
git clone https://github.com/pmmp/pocketmine-mp.git --recursive # don't forget the --recursive flag!
Install dependencies using Composer
Basic version:
path/to/php path/to/composer.phar install
or, if you have a global Composer installation:
composer install
or, if you’re using a prebuilt PHP provided by PMMP, a wrapper for Composer is provided:
bin/composer install
If you’re running a production server, you might want to skip dev dependencies and generate a faster autoloader:
bin/composer install --no-dev --classmap-authoritative
See the docs at https://getcomposer.org for more information on using Composer.
Warning
Remember to clone with the --recursive
flag! PocketMine-MP has several submodules which are required to run the server.
If you forgot the --recursive
flag when you cloned, you can cd into the server directory and run git submodule update --init --recursive
.
Warning
If running a production server, consider using a phar instead for better performance.
第一次开始接触¶
- Linux/MacOS: 运行
./start.sh
- Windows: 双击
start.cmd
,或者在服务器目录中打开PowerShell并运行.\start.ps1
.
第一次pocketmine - mp启动时,它启动一个设置向导。这可以通过运行 ./start.sh --no-wizard
来禁用。
$ ./start.sh
[*] PocketMine-MP set-up wizard
[*] Please select a language:
English => en
Español => es
ä¸æ–‡ => zh
Pyccĸий => ru
日本語 => ja
Deutsch => de
í•œêµì–´ => ko
Nederlands => nl
Français => fr
Italiano => it
Melayu => ms
Norsk => no
Svenska => sv
Suomi => fi
Türkçe => tr
[?] Language (en):
PocketMine-MP支持其他几种语言。 在语言后面填上这两个字母,然后按回车键。 你的语言不在列表中吗?将其添加在Crowdin.
[*] English has been correctly selected.
Welcome to PocketMine-MP!
Before starting setting up your new server you have to accept the license.
PocketMine-MP is licensed under the LGPL License,
that you can read opening the LICENSE file on this folder.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
[?] Do you accept the License? (y/N):
你支持 License 吗?
[?] Do you want to skip the set-up wizard? (y/N):
您可以从这里跳过向导,使用默认设置启动服务器,或者继续。
[*] You are going to set up your server now.
[*] If you don't want to change the default value, just press Enter.
[*] You can edit them later on the server.properties file.
[?] Give a name to your server (Minecraft: PE Server):
[*] Do not change the default port value if this is your first server.
[?] Server port (19132):
[*] Choose between Creative (1) or Survival (0)
[?] Default Game mode (0):
[?] Max. online players (20):
[*] The spawn protection disallows placing/breaking blocks in the spawn zone except for OPs
[?] Enable spawn protection? (Y/n):
[*] An OP is the player admin of the server. OPs can run more commands than normal players
[?] OP player name (example, your game name):
[!] You will be able to add an OP user later using /op <player>
[*] The white-list only allows players in it to join.
[?] Do you want to enable the white-list? (y/N):
[!] Query is a protocol used by different tools to get information of your server and players logged in.
[!] If you disable it, you won't be able to use server lists.
[?] Do you want to disable Query? (y/N):
[*] RCON is a protocol to remote connect with the server console using a password.
[?] Do you want to enable RCON? (y/N):
[*] Getting your external IP and internal IP
[!] Your external IP is [your external IP]. You may have to port-forward to your internal IP [your internal IP]
[!] Be sure to check it, if you have to forward and you skip that, no external players will be able to join. [Press Enter]
[*] You have finished the set-up wizard correctly
[*] Check the Plugin Repository to add new features, minigames, or advanced protection to your server
[*] PocketMine-MP will now start. Type /help to view the list of available commands.
[10:18:38] [Server thread/INFO]: Loading pocketmine.yml...
[10:18:38] [Server thread/INFO]: Loading server properties...
[10:18:38] [Server thread/INFO]: Selected English (eng) as the base language
[10:18:38] [Server thread/INFO]: Starting Minecraft: PE server version v1.1.0.55
[10:18:38] [Server thread/INFO]: Opening server on 0.0.0.0:19132
[10:18:38] [Server thread/INFO]: This server is running PocketMine-MP version 1.7dev "[REDACTED]" (API 3.0.0-ALPHA7)
[10:18:38] [Server thread/INFO]: PocketMine-MP is distributed under the LGPL License
[10:18:38] [Server thread/INFO]: Loading recipes...
[10:18:38] [Server thread/INFO]: Loading resource packs...
[10:18:39] [Server thread/NOTICE]: Level "world" not found
[10:18:39] [Server thread/INFO]: Preparing level "world"
[10:18:39] [Server thread/NOTICE]: Spawn terrain for level "world" is being generated in the background
[10:18:39] [Server thread/INFO]: Starting GS4 status listener
[10:18:39] [Server thread/INFO]: Setting query port to 19132
[10:18:39] [Server thread/INFO]: Query running on 0.0.0.0:19132
[10:18:39] [Server thread/INFO]: Default game type: Survival Mode
[10:18:39] [Server thread/INFO]: Done (59.006s)! For help, type "help" or "?"
服务器现在应该已经启动了,您应该能够加入。
配置¶
默认配置文件¶
server.properties¶
关于属性的更多信息可以在 Minecraft wiki 上面找到。
server-name=Minecraft: PE Server
server-port=19132
memory-limit=256M
gamemode=0
max-players=20
spawn-protection=16
white-list=off
enable-query=on
enable-rcon=off
motd=Minecraft: PE Server
announce-player-achievements=on
allow-flight=off
spawn-animals=on
spawn-mobs=on
force-gamemode=off
hardcore=off
pvp=on
difficulty=1
generator-settings=
level-name=world
level-seed=
level-type=DEFAULT
rcon.password=lT47ZUZs8L
auto-save=on
pocketmine.yml¶
# PocketMine-MP主要的配置文件
# 这些设置是不能包含在server.properties中的
# 其中一些设置是安全的,如果修改错误,其他设置可能会破坏您的服务器
# 当升级时,新设置/默认值不会自动出现在这个文件上。
settings:
#服务器端本地化的三字母语言代码
#检查你的语言代码 https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes
language: "eng"
#是否将所有字符串发送到服务器区域或让设备处理它们
force-language: false
shutdown-message: "Server closed"
#允许通过查询列出插件
query-plugins: true
#在插件使用过时的API方法时显示控制台消息
deprecated-verbose: true
#启用插件和核心概要文件默认
enable-profiling: false
#只有当tick的测量值低于或等于给定值时才会添加结果(默认值为20)
profile-report-trigger: 20
#AsyncTask工人的数量。
#用于插件异步任务、世界生成、压缩和web通信。
#将此设置为您的核心数量。
#如果设置为auto,则将尝试检测内核数(或使用2)
async-workers: auto
memory:
#兆字节的全局软内存限制。设置为0禁用
#这将触发低内存触发器,并在使用时触发事件以释放内存
global-limit: 512
#Main thread soft memory limit in megabytes. Set to 0 to disable
#This will trigger low-memory-triggers and fire an event to free memory when the usage goes over this
main-limit: 320
#Period in ticks to check memory (default 1 second)
check-rate: 20
#Continue firing low-memory-triggers and event while on low memory
continuous-trigger: true
#Only if memory.continuous-trigger is enabled. Specifies the rate in memory.check-rate steps (default 30 seconds)
continuous-trigger-rate: 30
garbage-collection:
#Period in ticks to fire the garbage collector manually (default 30 minutes), set to 0 to disable
#This only affect the main thread. Other threads should fire their own collections
period: 36000
#Fire asynchronous tasks to collect garbage from workers
collect-async-worker: true
#Trigger on low memory
low-memory-trigger: true
max-chunks:
#Limit of chunks to load per player, overrides chunk-sending.max-chunks
trigger-limit: 96
#Do chunk garbage collection on trigger
trigger-chunk-collect: true
#Trigger on low memory
low-memory-trigger: true
world-caches:
disable-chunk-cache: true
low-memory-trigger: true
network:
#Threshold for batching packets, in bytes. Only these packets will be compressed
#Set to 0 to compress everything, -1 to disable.
batch-threshold: 256
#Compression level used when sending batched packets. Higher = more CPU, less bandwidth usage
compression-level: 7
#Use AsyncTasks for compression. Adds half/one tick delay, less CPU load on main thread
async-compression: false
#Experimental, only for Windows. Tries to use UPnP to automatically port forward
upnp-forwarding: false
debug:
#If > 1, it will show debug messages in the console
level: 1
#Enables /status, /gc
commands: false
level-settings:
#The default format that levels will use when created
default-format: mcregion
#If true, converts from a format that is not the default to the default format on load
#NOTE: This is currently not implemented
convert-format: false
#Automatically change levels tick rate to maintain 20 ticks per second
auto-tick-rate: true
auto-tick-rate-limit: 20
#Sets the base tick rate (1 = 20 ticks per second, 2 = 10 ticks per second, etc.)
base-tick-rate: 1
#Tick all players each tick even when other settings disallow this.
always-tick-players: false
chunk-sending:
#Amount of chunks sent to players per tick
per-tick: 4
#Amount of chunks sent around each player
max-chunks: 192
#Amount of chunks that need to be sent before spawning the player
spawn-threshold: 56
#Save a serialized copy of the chunk in memory for faster sending
#Useful in mostly-static worlds where lots of players join at the same time
cache-chunks: false
chunk-ticking:
#Max amount of chunks processed each tick
per-tick: 40
#Radius of chunks around a player to tick
tick-radius: 3
light-updates: false
clear-tick-list: true
chunk-generation:
#Max. amount of chunks in the waiting queue to be generated
queue-size: 8
#Max. amount of chunks in the waiting queue to be populated
population-queue-size: 8
ticks-per:
animal-spawns: 400
monster-spawns: 1
autosave: 6000
cache-cleanup: 900
spawn-limits:
monsters: 70
animals: 15
water-animals: 5
ambient: 15
auto-report:
#Send crash reports for processing
enabled: true
send-code: true
send-settings: true
send-phpinfo: false
host: crash.pocketmine.net
anonymous-statistics:
#Sends anonymous statistics for data aggregation, plugin usage tracking
enabled: true
host: stats.pocketmine.net
auto-updater:
enabled: true
on-update:
warn-console: true
warn-ops: true
#Can be development, beta or stable.
preferred-channel: beta
#If using a development version, it will suggest changing the channel
suggest-channels: true
host: www.pocketmine.net
aliases:
#Examples:
#showtheversion: version
#savestop: [save-all, stop]
worlds:
#These settings will override the generator set in server.properties and allows loading multiple levels
#Example:
#world:
# seed: 404
# generator: FLAT:2;7,59x1,3x3,2;1;decoration(treecount=80 grasscount=45)
更新¶
Update using the installer (Linux/MacOS only)¶
You can also use the installer on these platforms to update your installation. Passing the -u
flag will update the PocketMine-MP installation.
cd into your server directory.
Then use curl
or wget
to update PocketMine-MP using the following command:
curl -sL https://get.pmmp.io | bash -s - -u
wget -q -O - https://get.pmmp.io | bash -s - -u
Manually update¶
Update PHP binary¶
- Download the PHP binary for your OS (Downloads)
- Delete the
bin
directory in your server folder. - Extract the new PHP binary. You should see a new
bin
directory has been created.
Updating PocketMine-MP¶
Updating using .phar¶
This is very straightforward.
- Delete your current PocketMine-MP.phar
- Download the updated PocketMine-MP phar you want to use (Downloads)
- Change the name to
PocketMine-MP.phar
- Place it in the server folder
Note
Don’t forget to rename the file to PocketMine-MP.phar
Updating a Git installation¶
If you used Git to install, updating is very simple.
cd into the server directory and run the following:
git pull # get the latest source from GitHub
git submodule update # update submodules to the required versions
composer install [... optional extra composer flags] # install/update dependencies managed by Composer
See Installing using Git for more details.
Note
Previous versions of PocketMine-MP used submodules src/spl
and src/raklib
, which have now been removed. These submodules need to be manually deleted in your local installation.
To do so, delete the spl
and raklib
directories in the src
directory, and then re-run Composer.
FAQ¶
Installation¶
Failed loading opcache.so (or other PHP extensions)¶
This may happen when the installer is not used or when PocketMine-MP was moved.
To fix this issue, run the following from wherever your PHP bin directory is:
EXTENSION_DIR=$(find "$(pwd)/bin" -name *debug-zts*)
grep -q '^extension_dir' bin/php7/bin/php.ini && sed -i'bak' "s{^extension_dir=.*{extension_dir=\"$EXTENSION_DIR\"{" bin/php7/bin/php.ini || echo "extension_dir=\"$EXTENSION_DIR\"" >> bin/php7/bin/php.ini
This will locate your PHP binary’s extension_dir on the disk and set it into php.ini, replacing it if it already exists, and adding it if not.
Can’t install as user root¶
Warning
This script is running as root, this is discouraged. It is recommended to run it as a normal user as it doesn’t need further permissions.
We recommend you to install PocketMine-MP as a normal user, not as root. Create one if you don’t have one.
useradd -d /home/pocketmine -m pocketmine
passwd pocketmine
Can I install PocketMine-MP on Windows XP¶
PocketMine-MP can not be installed on Windows XP. Is it an old computer? Try Linux!
Connecting¶
Can’t connect to the server¶
Run the version
command to check the supported MCPE version or Supported MCPE Versions.
Example:
for Minecraft: PE v0.10.5 alpha protocol version 20
for Minecraft: PE v0.11.0 alpha (protocol version 27)
Opening server on 0.0.0.0:19132¶
0.0.0.0
means “all IPv4 addresses on the local machine”.
If a host has two ip addresses, 192.168.1.1
and 10.1.2.1
, and a server running on the host listens on 0.0.0.0
,
it will be reachable at both of those IPs.
How do I connect to a server¶
Fill in the server details and you should be ready to go!
Note
A local server should show up on the Play screen without adding the details.
Do I have to open ports¶
If you have a firewall setup then you need to allow access to UDP port 19132
.
Note
Do you want to use RCON then TCP port 19132
also needs to be open.
Can other users connect to my server¶
Users on the same network are able to join the server. If you want other people from outside your own network to be able to join then you need to port-forward.
Do I have to configure port forwarding¶
This is only needed when you want people from outside your network to connect. Check portforward.com or use Google to find the instructions. Use the brand and type of your router as keywords.
Note
- UDP port: 19132 for PocketMine-MP and Query
- TCP port: 19132 for RCON
RakLib Thread Blocked x.x.x.x for x seconds¶
Timeout | Reason |
---|---|
5 seconds | Error on a normal MCPE packet |
300 seconds | More then 5000 packets per tick from one address |
600 seconds | Errors on external packet (like Query or RCON) |
Can’t connect to localhost Win10 server with Minecraft Win10 Edition¶
Launch Window PowerShell as an administrator and run the following:
CheckNetIsolation LoopbackExempt -a -n="Microsoft.MinecraftUWP_8wekyb3d8bbwe"
Plugins¶
How do I install plugins¶
Download the .phar
file and move it to the plugins
folder.
Can I use .php files¶
Yes, but only when the DevTools plugin is installed and the plugin/PocketMine API versions are both the same. Take a look at the plugin example
For small test plugins there is a new way, check out this forum thread
Developers Information¶
Contributing Code¶
- Use the Pull Request system, your request will be checked and discussed.
- Create a single branch for that pull request
- Code using the syntax as in PocketMine-MP. See below for an example.
- The code must be clear and written in English, comments included.
Check the Contribution Guidelines on github for more information.
Thanks for contributing to PocketMine-MP!
Extending PocketMine-MP¶
PocketMine-MP has an API that you can use to add new things. For more information look at the plugins page.
How to use git¶
Clone PocketMine-MP¶
Get the clone URL from pmmp/pocketmine-mp
$ git clone --recursive https://github.com/pmmp/pocketmine-mp.git # clone the original repository into PocketMine-MP.git
$ cd pocketmine-mp.git # change directory to PocketMine-MP.git
How to make a pull request¶
Go to the pmmp/pocketmine-mp repository and hit the Fork button. You should now have a forked repo from pmmp/pocketmine-mp in your own repositories.
Get the clone URL from the fork and clone it into another directory:
$ git clone git clone <YOUR SSH/HTTPS clone URL> pocketmine-mp-fork.git # clone the original repository into PocketMine-MP-Fork.git
$ git checkout -b feature # create and switch to branch feature (it can be any name)
$ git branch # shows current branch
* feature # current branch
master
Make your changes to the code and commit it:
Note
Only commit changes described in the commit message
$ git status # check the status
$ git add <filename> # add all changed files
$ git commit -m 'description of changes' # make a commit with a message
$ git push origin feature # push to your branch
Take a look at GitHub and make a pull request. If the pull request is accepted and merged, you can pull the changes back into your fork.
Note
To pull from the original repository you need to add the upstream
$ git remote add upstream https://github.com/pmmp/pocketmine-mp.git
$ git checkout master # switch back to the master branch
$ git fetch upstream # download latest commits from the upstream
$ git merge upstream/master # merge changes from upstream/master into your master branch
Remove the branch you made with
$ git branch -d feature # remove the branch to keep it clean
Plugins¶
PocketMine is extendable!
Plugins are available on Poggit or you can make your own plugin.
Below is an skeleton with the minimal needed directories, files and content.
Note
This example was last updated for API 3.0.0-ALPHA7 and may be outdated and/or not work correctly. Please feel free to make a GitHub pull request if you find problems with it.
Note
To run plugins from source or create .phar files you need the DevTools plugin.
Basic plugin structure¶
Directories¶
Make sure your base structure looks like this
PocketMine-MP
└── plugins
└── Example
├── plugin.yml
└── src
└── Example
└── Example.php
5 directories, 2 files
plugin.yml¶
This file is required in a plugin. It contains the information used by PocketMine-MP to load this plugin. It’s in YAML format (you will use this format for plugin configurations). It has four required fields: name, version, api and main. Each one of these fields (and all the optional ones) are described on the plugin.yml page. Be sure that it is named exactly plugin.yml.
field | data |
---|---|
name | The name for your plugin |
main | The namespace and classname pointing to your main plugin class. It is case sensitive |
version | The version string of your plugin |
api | Minimum PocketMine-MP API version required for your plugin (current) |
name: Example
main: Example\Example
version: 1.0.0
api: 3.0.0-ALPHA7
Example.php¶
Now, create the main class file, that will include the PluginBase Class that starts the plugin. You can name it whatever you want, but a common way to name it is like the plugin name or Main.
<?php
namespace Example;
use pocketmine\plugin\PluginBase;
class Example extends PluginBase{
public function onLoad(){
$this->getLogger()->info("onLoad() has been called!");
}
public function onEnable(){
$this->getLogger()->info("onEnable() has been called!");
}
public function onDisable(){
$this->getLogger()->info("onDisable() has been called!");
}
}
Create .phar files¶
The easiest way to release a plugin is in .phar format. To create a .phar you need DevTools.
- Start PocketMine-MP
- Make sure the plugin is loaded. Look for
Loading source plugin <plugin name>
- Run
makeplugin <plugin name>
The <plugin name>
should be the same as the name in plugin.yml.
# Output for the Example plugin
[Server thread/INFO]: Loading source plugin Example v1.0.0
[Server thread/INFO]: [Example] onLoad() has been called!
[Server thread/INFO]: Enabling Example v1.0.0
[Server thread/INFO]: [Example] onEnable() has been called!
makeplugin Example
[Server thread/INFO]: [DevTools] Adding plugin.yml
[Server thread/INFO]: [DevTools] Adding src/Example/Example.php
[Server thread/INFO]: Phar plugin Example v1.0.0 has been created on /Pocketmine-MP/dev/plugins/DevTools//Example_v1.0.0.phar
More examples¶
Commands¶
Note
This example was last updated for API 3.0.0-ALPHA7 and may be outdated and/or not work correctly. Please feel free to make a GitHub pull request if you find problems with it.
name: Example
main: Example\Example
version: 1.0.0
api: 3.0.0-ALPHA7
commands:
example1:
description: "Example1 command"
usage: "/example1"
example2:
description: "Example2 command with arguments"
usage: "/example2 <args>"
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | <?php
namespace Example;
use pocketmine\plugin\PluginBase;
use pocketmine\command\Command;
use pocketmine\command\CommandSender;
class Example extends PluginBase{
public function onCommand(CommandSender $sender, Command $command, string $label, array $args) : bool{
switch($command->getName()){
case "example1":
// do stuff
return true;
case "example2":
if (count($args) === 0){
return false;
}
var_dump($args); // do stuff
return true;
}
return false; //don't forget the return!
}
}
|
Resources¶
Issues¶
Did your server crash, or did you encounter a bug?
- Make sure you’re using the latest available version of PocketMine-MP, as the bug might already have been fixed.
- Try and reproduce it WITHOUT PLUGINS, as plugins can frequently cause issues.
- Ask for help on our forums before creating an issue.
Warning
Please do not use our issue tracker for support requests, but instead seek assistance on the forums. Support request issues will be closed as per the contribution guidelines.
Note
Make sure you read the contribution guidelines before creating an issue.
If your issue is still unresolved and you’re sure the issue is caused by PocketMine-MP itself, then make a new issue on GitHub.
Issue template¶
An issue template is provided, showing the information that we require for an issue submission. Do not just delete the template - fill it with the information it asks for. Give as much information as you can about when or what happened.
Crashdumps¶
Did the server crash and generate a crash dump? When the server creates a crashdump, it attempts to send it to our crash archive (unless the user disables this in their pocketmine.yml).
If it succeeds, you will see a message like this:
[18:34:15] [Server thread/EMERGENCY]: The crash dump has been automatically submitted to the Crash Archive. You can view it on https://crash.pmmp.io/view/5555 or use the ID #5555.
When you create your issue, please include the link to your crashdump to help us diagnose the problem.
If you don’t have a link but have a crashdump, you can submit it manually at https://crash.pmmp.io/submit
Error
Please DO NOT paste crashdump contents into an issue. Upload it to the Crash Archive instead.
Contact and Support¶
- PocketMine Forums
- #pocketmine for support @ chat.freenode.net
Links¶
Downloads¶
PocketMine-MP prebuilt phars¶
There are 4 available channels for downloads (ordered least stable to most stable):
- Development (least stable, produced for every commit to master)
- Alpha (lacking planned features, may be unstable)
- Beta (may be unstable)
- Stable
You are recommended to take the most stable build which is compatible with your Minecraft version. You can see the compatible Minecraft version and other information by looking at the build_info.json
file in the artifacts.
Warning
Do not use development builds unless there is no other option available, since these will undergo breaking changes without notice from build to build. You are recommended to use Alpha, Beta or Stable builds, as those are in a known state and all the changes for those are fully documented.
Note
The links above may yield “404 Not Found” if no build is available in that channel. At the time of writing, only Development and Alpha builds are currently available since PocketMine-MP is currently under heavy development. You are currently recommended to take Alpha builds or better.
Note
Compatible DevTools phars are also shipped in every PocketMine-MP build from our Jenkins server.