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

SetSpawnPoint with PlayerMoveEvent

Discussion in 'Plugin Help' started by M4nt0s, Mar 12, 2017.

  1. M4nt0s

    M4nt0s Spider Jockey

    Messages:
    31
    GitHub:
    M4nt0s
    If a Player move on a DiamondBlock. How to set his spawnpoint 2 Blocks higher than the block he is moving with PlayeMoveEvent?
     
  2. Az928

    Az928 Baby Zombie

    Messages:
    140
    GitHub:
    theaz928
    PHP:
    $block $event->getPlayer()->getLevel()->getBlock($event->getPlayer()->floor()->subtract(01));
            if(
    $block instanceof Block) {
                
    $id $block->getId();
                if(
    $id == 57){
                 
    // Your code goes here
    You may need to save last cords to a file and use it on player join event or you can also use pocketmine built-in command "setspawnpoint"
     
  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.