diff --git a/src/pocketmine/event/player/PlayerRespawnEvent.php b/src/pocketmine/event/player/PlayerRespawnEvent.php index bbf3cf220..1dad225c6 100644 --- a/src/pocketmine/event/player/PlayerRespawnEvent.php +++ b/src/pocketmine/event/player/PlayerRespawnEvent.php @@ -43,6 +43,9 @@ class PlayerRespawnEvent extends PlayerEvent{ } public function setRespawnPosition(Position $position) : void{ + if(!$position->isValid()){ + throw new \InvalidArgumentException("Spawn position must reference a valid and loaded World"); + } $this->position = $position; } }