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

How to spawn a chest facing the player

Discussion in 'Development' started by Aviv, May 2, 2017.

  1. Aviv

    Aviv Baby Zombie

    Messages:
    156
    How can i spawn the chest facing the player?

    Thanks in advance!
     
  2. Aviv

    Aviv Baby Zombie

    Messages:
    156
    Oh nvm just looked at the source XD
    Sorry for spammed thread
     
  3. Lowkey

    Lowkey Slime

    Messages:
    94
    It is recommended that you post your solution, resulting in spam prevention of the same thread.
     
  4. Aviv

    Aviv Baby Zombie

    Messages:
    156
    The solution is already in the source...
    but
    PHP:
    $faces = [
        
    => 4,
        
    => 2,
        
    => 5,
        
    => 3,
    ];
    $block->setDamage($faces[$player instanceof Player $player->getDirection() : 0]);
    -.-
     
  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.