how can i try cancelling xp orbs for entities? 1. i tried by setting their xp drop to 0 in a custom class extending the pocketmine one 2. tried calling entityspawnevent then if its xp orb cancel event (threw cannot canel event error) 3. tried despawning it when its spawn ( garbage entity error ) 4. tried getting drops if its xp orb remove it none worked so yeah. forums is my last hope
Simply set their xp to 0 when they die PHP: public function onDeath(PlayerDeathEvent $event){$player = $event->getPlayer();$player->setCurrentTotalXp(0);}
Oh, maybe use entitydeathevent then? This is all i can think of rn PHP: public function onEntityDeath(EntityDeathEvent $event){ //you might need to check if its not instance of player $event->getEntity()->close(); //Thisll also stop the death animation and drops tho, you can set the drops again i guess. }