how can I get a cow entity? public function onCow(EntityDeathEvent $event){ if($event->getEntity() === ???){
You can try: PHP: //use pocketmine\entity\Cow;public function getCow(EntityDeathEvent $e){$entity = $e->getEntity();if($entity instanceof Cow){//Something here}}
PHP: func getNetworkId(Entity $entity): int { return get_class($entity)::NETWORK_ID;} Then you can check if it equals to Cow's network id PHP: getNetworkId($entity) === Cow::NETWORK_ID# Or, as I previously heard that Cow class does not existgetNwtworkId($entity) === 11 // According to http://minecraft.gamepedia.com/Pocket_Edition_data_values