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

How to get the Coordonnee of the Spawn

Discussion in 'Development' started by Palente, Dec 14, 2016.

  1. Palente

    Palente Slime

    Messages:
    75
    GitHub:
    palente
    Hey,
    I want to get The position of the Spawn not with a player
    I have searched quickly
    and i find nothing ☺☺
    PHP:
    public function onEnable() {
    $config = new Config($this->getDataFolder() . "config.yml"Config::YAML);
    }
    I want to get the original Spawn
    and save it in the config like that
    $config->set("spawn", $coordonesofthespawn);
     
  2. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
  3. Palente

    Palente Slime

    Messages:
    75
    GitHub:
    palente
    Okay, Thanks but How I use it???
     
  4. Aviv

    Aviv Baby Zombie

    Messages:
    156
    get the default level of your server
    PHP:
    $this->getServer()->getDefaultLevel();
    get its spawn
    PHP:
    $defaultLevel->getSpawnLocation();
    Done!
    full code:
    PHP:
    $this->getServer()->getDefaultLevel()->getSpawnLocation();
     
    Palente likes this.
  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.