its not perfect and with POSTWORLD and "onEnable" it doesnt work but set a public var. set this to 0 "on enable" (because onenable dont let u show all world entites dont know why) on first player join PHP: public function onJoin(PlayerJoinEvent $event) { if($this->var == 0) //that the code only do it once { $entities = $this->getServer()->getLevelbyName("***")->getEntities(); // u can also use get default world foreach($entities as $human) { if(strpos(strtolower($human),"human") !==false) //check if the entitiy is a human entity { //do something } } $this->var = 1; } } if u creater only human entities u can get thgem all and do something with them.
hm when i have any entities on server so sometimes there is a bug when i join MCPE crashes always. i solve it i teleport me to another place from console but why it happens? (i have the newest MCPE version)