If a Player move on a DiamondBlock. How to set his spawnpoint 2 Blocks higher than the block he is moving with PlayeMoveEvent?
PHP: $block = $event->getPlayer()->getLevel()->getBlock($event->getPlayer()->floor()->subtract(0, 1)); 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"