I tried to get the chunk where a player is. But it isn't working. I think they changed something with the chunks?! PHP: $chunk = $source->getLevel()->getChunk($source->x >> 4, $source->z >> 4, true);//$source is the player
This is the error: (Vardump looks normal) PHP: Argument 2 passed to pocketmine\entity\Entity::createEntity() must be an instance of pocketmine\level\Level, instance of pocketmine\level\format\Chunk given
read the error. you have to give it a Level. There was an api change for 3.0.0-ALPHA4 that changed the way of creating entities, and removed their entanglement with chunks https://github.com/pmmp/PocketMine-MP/commit/c21197ef176166b1c2c19b091cf84664aa878c00
please read the commit description in the link. quote: All entity and tile constructors now require a \pocketmine\level\Level instead of a \pocketmine\level\format\Chunk. okay, if that's too complicated for you how about: https://github.com/pmmp/PocketMine-...c00#diff-9649873f1670ddd60984257dd0380943R524 still not clear? PHP: /** @var $source pocketmine\entity\Entity */Level::createEntity($blah1, $source->getLevel()->getChunk($source->x >> 4, $source->z >> 4, true), $blah2);//is nowLevel::createEntity($blah1, $source->getLevel(), $blah2);
Were there any errors? You may need to use this to get it to display: PHP: $entity->setNameTagVisible(true);