(4.0.0 - 4.21.1) 2.0.0-beta1 (4.0.0 - 4.21.1) 1.7.0 (4.0.0 - 4.21.1) 1.7.0-beta4 (4.0.0 - 4.21.1) 1.7.0-beta3 (4.0.0 - 4.21.1) 1.7.0-beta2 (3.20.0 - 3.25.6) 1.6.0-beta6 (3.20.0 - 3.25.6) 1.6.0-beta5 (3.20.0 - 3.25.6) 1.6.0-beta4 (3.20.0 - 3.25.6) 1.6.0-beta3 (3.20.0 - 3.25.6) 1.6.0-beta2 (3.20.0 - 3.25.6) 1.6.0-beta1 (3.20.0 - 3.25.6) 1.5.3 (3.0.0-ALPHA7 - 3.25.6) 1.4.3 (3.0.0-ALPHA7 - 3.0.0-ALPHA12) 1.4.2 (3.0.0-ALPHA7 - 3.0.0-ALPHA12) 1.4.1 (3.0.0-ALPHA7 - 3.0.0-ALPHA11) 1.4.0 (3.0.0-ALPHA7 - 3.0.0-ALPHA10) 1.3.3 (3.0.0-ALPHA7 - 3.0.0-ALPHA7) 1.3.1 (3.0.0-ALPHA7 - 3.0.0-ALPHA7) 1.3.0 (5.0.0 - 5.16.0) 2.1.0-beta2 (5.3.0 - 5.16.0) 2.1.0-beta3 (5.3.0 - 5.16.0) 2.1.0 (5.3.0 - 5.16.0) 2.1.1
Command | Description |
---|---|
/mw help |
Displays list of all MultiWorld commands Alias: /mw ? Usage: /mw help <page: 0-1>
|
/mw create |
Generate new world using seed and generator Aliases: /mw new , /mw generate Usage: /mw create <levelName> [seed] [generator] Seed is value seed is the initial value by which the world is generated, when you set it empty, world will be generated by random number. You can use 6 generators ( Normal , Nether , End , Void , SkyBock and Nether_Old = Nether generator without glowstone and quartz ore) |
/mw teleport |
Teleports you or seleced player to world spawn Aliases: /mw tp , /tp move Usage: /mw tp <levelName> [player] If you are using Slapper plugin and after you click on the npc you want to move the player to another world, you can use /slapper edit <id> addcommand mw tp <world> {player} command |
/mw list |
Displays list of all levels Alias: /mw ls Usage: /mw list
|
/mw info |
Displays level information Alias: /mw i Usage: /mw info This command can be used only in game |
/mw delete |
Remove level Aliases: /mw del , /mw dl , /mw remove , /mw rm Usage: /mw remove <level> Default level can not be deleted |
/mw update |
Change spawn, lobby or default level Aliases: /mw ue Usage: `/mw update <spawn |
/mw load |
Loads level Aliases: /mw ld Usage: /mw load <level>
|
/mw unload |
Unloads level Aliases: /mw unld Usage: /mw unload <level>
|
/mw gamerule |
Manage with level game rules Aliases: /gamerule , /mw gr , /mw gamer , /mw grule Usage: `/gamerule <list |
/mw rename |
Renames level Aliases: /mw rnm , /mw re Usage: /mw rename <levelName> <newName> This command changes name of the folder and of nbt too. |
/mw manage |
Opens world form manager Aliases: /mw mng , /mw mg Usage: /mw manage The form manager just dispatches command as a player, so player needs also permission for the command. |
Permission | Command | Opertor |
---|---|---|
mw.cmd.help | /mw help |
|
mw.cmd.create | /mw create |
|
mw.cmd.teleport | /mw teleport |
|
mw.cmd.list | /mw list |
|
mw.cmd.info | /mw info |
|
mw.cmd.delete | /mw delete |
|
mw.cmd.update | /mw update |
|
mw.cmd.load | /mw load |
|
mw.cmd.unload | /mw unload |
|
mw.cmd.gamerule | /mw gamerule |
|
mw.cmd.rename | /mw rename |
|
mw.cmd.manage | /mw manage |
|
mw.cmd | All the MultiWorld commands |
/**
* @param string $levelName
*
* @return bool
*/
public function reloadWorld(string $levelName): bool {
if(!WorldManagementAPI::isLevelGenerated($levelName)) {
return false;
}
if(!WorldManagementAPI::isLevelLoaded($levelName)) {
WorldManagementAPI::loadLevel($levelName);
}
WorldManagementAPI::removeLevel($levelName);
WorldManagementAPI::generateLevel($levelName, rand(0, 100), WorldManagementAPI::GENERATOR_SKYBLOCK);
return true;
}
doDaylightCycle
, doMobLoot
, doTileDrops
, keepInventory
, naturalRegeneration
, pvp
, showcoordinates
and tntexplodes
GameRules
, you can look at it using NBTEditor.<?php
declare(strict_types=1);
namespace xyz;
use multiworld\api\WorldGameRulesAPI;
use pocketmine\command\Command;
use pocketmine\command\CommandSender;
use pocketmine\event\level\LevelLoadEvent;
use pocketmine\event\Listener;
use pocketmine\plugin\PluginBase;
/**
* Class XYZPlugin
* @package xyz
*/
class XYZPlugin extends PluginBase implements Listener {
/** @var bool $enabled */
private $enabled = false;
public function onEnable() {
$this->getServer()->getPluginManager()->registerEvents($this, $this);
$this->update();
}
/**
* @param CommandSender $sender
* @param Command $command
* @param string $label
* @param array $args
*
* @return bool
*/
public function onCommand(CommandSender $sender, Command $command, string $label, array $args): bool {
if($command->getName() !== "xyz") {
return false;
}
$bool = $this->enabled ? "off" : "on";
$sender->sendMessage("§a> Coordinates turned $bool!");
$this->enabled = !$this->enabled;
$this->update();
return true;
}
/**
* @param LevelLoadEvent $event
*/
public function onLevelLoad(LevelLoadEvent $event) {
WorldGameRulesAPI::updateLevelGameRule($event->getLevel(), "showcoordinates", $this->enabled);
}
private function update() {
foreach ($this->getServer()->getLevels() as $level) {
WorldGameRulesAPI::updateLevelGameRule($level, "showcoordinates", $this->enabled);
}
}
}
MultiWorld - PocketMine plugin that manages worlds.
Copyright (C) 2018-2020 CzechPMDevs
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Full license here.