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

Compass Orientation

Discussion in 'Development' started by DiamondGamer30, Jul 3, 2018.

  1. DiamondGamer30

    DiamondGamer30 Baby Zombie

    Messages:
    175
    GitHub:
    diamondgamermcpe
    How would I set compass orientation?
     
    Levi likes this.
  2. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    Muqsit likes this.
  3. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    PHP:
            $spawn $this->getServer()->getDefaultLevel()->getSafeSpawn();
            
    $pk = new SetSpawnPositionPacket();
            
    $pk->$spawn->getX();
            
    $pk->$spawn->getY();
            
    $pk->$spawn->getZ();
            
    $player->dataPacket($pk); 
     
  4. DiamondGamer30

    DiamondGamer30 Baby Zombie

    Messages:
    175
    GitHub:
    diamondgamermcpe
    What about spawnType and spawnForced.
     
  5. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    You can use Player::setSpawn().
    PHP:
    /** @var Player $player */
    /** @var Vector3 $pos */
    $player->setSpawn($pos);
     
  6. DiamondGamer30

    DiamondGamer30 Baby Zombie

    Messages:
    175
    GitHub:
    diamondgamermcpe
    I tried it with the spawnpoint command but it didn't seem to affect the compass.
     
  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.