need /hub plugin

Discussion in 'Plugin Help' started by Jenno, Aug 13, 2019.

  1. Jenno

    Jenno Spider Jockey

    Messages:
    29
    GitHub:
    Jenno
    need /hub plugins becouse mcspawns and other plugins dont work between different worlds
     
  2. VirVolta

    VirVolta Silverfish

    Messages:
    16
    GitHub:
    VirvoltaSurMC
    You can create a command by teleporting the player into the SafeSpawn of the default world
     
  3. GamakCZ

    GamakCZ Zombie

    Messages:
    257
    GitHub:
    GamakCZ
  4. Jenno

    Jenno Spider Jockey

    Messages:
    29
    GitHub:
    Jenno
  5. Jenno

    Jenno Spider Jockey

    Messages:
    29
    GitHub:
    Jenno
    OK but I have no idea how.
     
  6. Willoxey

    Willoxey Creeper

    Messages:
    5
    Hi there! i was searching for a plugin that could do that too, but i didnt find. So if u have basic knowladge of PMP you can figure it out by your self. (you must have installed MultiWorld in your server)
    first of all in ur code import this: use czechpmdevs\multiworld\api\WorldManagementAPI;

    if($command->getName() === "hub") {
    if(!WorldManagementAPI::isLevelLoaded("TypeHereWorldName")) { //We need to check first if the world is loaded or not, in any other case it wont work
    WorldManagementAPI::loadLevel("TypeHereWorldName");
    }
    $sender->teleport($this->getServer()->getLevelByName("TypeHereWorldName")->getSafeSpawn());
    $sender->sendMessage( "You can put a message here");
    }

    If you have any question ask me
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.