1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

need /hub plugin

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

  1. Jenno

    Jenno Spider Jockey

    Messages:
    36
    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 Pigman

    Messages:
    598
    GitHub:
    GamakCZ
  4. Jenno

    Jenno Spider Jockey

    Messages:
    36
    GitHub:
    Jenno
  5. Jenno

    Jenno Spider Jockey

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

    Willoxey Spider Jockey

    Messages:
    33
    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
     
  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.