menu
#2387564 Call to undefined method pocketmine\event\entity\EntityDamageEvent::getDamager()

Submitted by PocketMine-MP 3.8.2

General information

Version: 3.8.2
Git commit: 5c81da9b
Plugin involvement: Direct
Report date: 2019-05-15 19:08:19 +0000 UTC

System Information

PHP version: 7.2.16
Operating system: win
System banner: Windows NT DESKTOP-P1RMD6P 10.0 build 17134 (Windows 10) AMD64

Error information

Warning: the GunShop plugin was directly involved in this crash. Please contact the plugin author.
Message: Call to undefined method pocketmine\event\entity\EntityDamageEvent::getDamager()
File: plugins/guns.phar/src/Gun/Main
Line: #104
Error level: Error
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
    if($child instanceof \pocketmine\entity\Egg){
$event->setDamage($event->getDamage()+$prices->get("Egg-Damage"));
}
}
}

public function onDeath(\pocketmine\event\player\PlayerDeathEvent $event){
$config = new Config($this->getDataFolder()."Coin.yml", Config::YAML);
$prices = new Config($this->getDataFolder()."Prices.yml", Config::YAML);
if($event->getEntity()->getLastDamageCause()->getDamager() instanceof Player){
$entity = $event->getEntity();
$damager = $event->getEntity()->getLastDamageCause()->getDamager();
$this->setCoins($damager, $config->get($damager->getName(), $this->getCoins($damager))+$prices->get("Coins-By-Kills"));
$damager->sendMessage(T::GOLD."+".T::GREEN."".$prices->get("Coins-By-Kills").T::GOLD." Coins");
$config->set($damager->getName(), $this->getCoins($damager));
$config->save();
}
}

public function onBreak(\pocketmine\event\block\BlockBreakEvent $e){
#0 src/pocketmine/plugin/MethodEventExecutor(38): Gun\Main->onDeath(pocketmine\event\player\PlayerDeathEvent object)
#1 src/pocketmine/plugin/RegisteredListener(98): pocketmine\plugin\MethodEventExecutor->execute(Gun\Main object, pocketmine\event\player\PlayerDeathEvent object)
#2 src/pocketmine/event/Event(99): pocketmine\plugin\RegisteredListener->callEvent(pocketmine\event\player\PlayerDeathEvent object)
#3 src/pocketmine/Player(3632): pocketmine\event\Event->call()
#4 src/pocketmine/entity/Living(637): pocketmine\Player->onDeath()
#5 src/pocketmine/Player(3621): pocketmine\entity\Living->kill()
#6 src/pocketmine/entity/Entity(1046): pocketmine\Player->kill()
#7 src/pocketmine/entity/Living(143): pocketmine\entity\Entity->setHealth(double -15)
#8 src/pocketmine/entity/Entity(991): pocketmine\entity\Living->setHealth(double -15)
#9 src/pocketmine/entity/Living(572): pocketmine\entity\Entity->attack(pocketmine\event\entity\EntityDamageEvent object)
#10 src/pocketmine/Player(3719): pocketmine\entity\Living->attack(pocketmine\event\entity\EntityDamageEvent object)
#11 src/pocketmine/entity/Living(410): pocketmine\Player->attack(pocketmine\event\entity\EntityDamageEvent object)
#12 src/pocketmine/Player(1688): pocketmine\entity\Living->fall(double 37.8426)
#13 src/pocketmine/entity/Entity(1537): pocketmine\Player->fall(double 37.8426)
#14 src/pocketmine/entity/Entity(1750): pocketmine\entity\Entity->updateFallState(double -0.29559999999999, boolean 1)
#15 src/pocketmine/Player(1609): pocketmine\entity\Entity->move(double 0, double -0.29559999999999, double 0)
#16 src/pocketmine/Player(1752): pocketmine\Player->processMovement(integer 1)
#17 src/pocketmine/level/Level(848): pocketmine\Player->onUpdate(integer 13094)
#18 src/pocketmine/level/Level(786): pocketmine\level\Level->actuallyDoTick(integer 13094)
#19 src/pocketmine/Server(2434): pocketmine\level\Level->doTick(integer 13094)
#20 src/pocketmine/Server(2565): pocketmine\Server->checkTickUpdates(integer 13094, double 1557947299.2881)
#21 src/pocketmine/Server(2334): pocketmine\Server->tick()
#22 src/pocketmine/Server(2195): pocketmine\Server->tickProcessor()
#23 src/pocketmine/Server(1774): pocketmine\Server->start()
#24 src/pocketmine/PocketMine(266): pocketmine\Server->__construct(BaseClassLoader object, pocketmine\utils\MainLogger object, string C:\Users\Ptryb\mcpe\, string C:\Users\Ptryb\mcpe\plugins\)
#25 (1): require(string phar://C:/Users/Ptryb/mcpe/PocketMine-MP.phar/src/pocketmine/PocketMine.php)

Loaded Plugins

  • Show

Server Settings

  • Show