Fatal error: Declaration of BattleRoyale\EntityManager::attack(pocketmine\event\entity\EntityDamageEvent $source) must be compatible with pocketmine\entity\Living::attack(pocketmine\event\entity\EntityDamageEvent $source): void in /storage/emulated/0/PocketMine-MP/plugins/BattleRoyale-master/src/BattleRoyale/EntityManager.php on line 60 on the console such error message Below is the code of the EntityManager.php file PHP: <?phpnamespace BattleRoyale;use pocketmine\Player;use pocketmine\entity\Living;use pocketmine\network\mcpe\protocol\AddEntityPacket;use pocketmine\event\entity\EntityDamageEvent;use pocketmine\nbt\tag\CompoundTag;use pocketmine\nbt\tag\ListTag;use pocketmine\nbt\tag\DoubleTag;use pocketmine\nbt\tag\FloatTag;abstract class EntityManager extends Living { public $width = 1; public function attack(EntityDamageEvent $source){ if($source->getCause() !== EntityDamageEvent::CAUSE_VOID){ $source->setCancelled(); }else{ if($this->isAlive()){ $this->close(); } } } public function spawnTo(Player $player){ $packet = new AddEntityPacket(); $packet->type = static::NETWORK_ID; $packet->motion = $this->getMotion(); $packet->position = $this->asVector3(); $packet->entityRuntimeId = $this->getId(); $packet->pitch = $this->pitch; $packet->yaw = $this->yaw; $packet->metadata = $this->getDataPropertyManager()->getAll(); $player->dataPacket($packet); parent::spawnTo($player); } public static function getCompoundMotion(Player $player): CompoundTag{ $data = new CompoundTag("", [ new ListTag("Pos", array( new DoubleTag("", $player->getX()), new DoubleTag("", $player->getY() + $player->getEyeHeight()), new DoubleTag("", $player->getZ()) )), new ListTag("Motion", array( new DoubleTag("", -sin($player->yaw / 180 * M_PI) * cos($player->pitch / 180 * M_PI)), new DoubleTag("", -sin($player->pitch / 180 * M_PI)), new DoubleTag("", cos($player->yaw / 180 * M_PI) * cos($player->pitch / 180 * M_PI)) )), new ListTag("Rotation", array( new FloatTag("", $player->yaw), new FloatTag("", $player->pitch) )) ]); return $data; }}
I added as you said but still got errors maybe I put it wrong or can you write down any additional details (I use Google Translate to communicate so there is a wrong word for the word)
Replace this: PHP: public function attack(EntityDamageEvent $source){ with this PHP: public function attack(EntityDamageEvent $source) : void{ and this PHP: public function spawnTo(Player $player){ with this PHP: public function spawnTo(Player $player) : void{
this is the plugins I downloaded the old api plugins is the api: 3.0.0-ALPHA12 I have upgraded to api 3.0.0 and there are too many errors here are the plugins I have fixed as you said but still have errors in the plugins below are the plugins I have correct but still have errors can also fix plugins to work properly or outdated plugins Here are the plugins I mentioned