menu
#4550402 Call to a member function getLastDamageCause() on null

Submitted by PocketMine-MP 3.15.1

General information

Version: 3.15.1
Git commit: 9f604842
Plugin involvement: Direct
Report date: 2020-09-26 19:17:36 +0000 UTC

System Information

PHP version: 7.3.22
Operating system: linux
System banner: Linux 4810 4.19.0-10-amd64 #1 SMP Debian 4.19.132-1 (2020-07-24) x86_64

Error information

Warning: the GunGame plugin was directly involved in this crash. Please contact the plugin author.
Message: Call to a member function getLastDamageCause() on null
File: plugins/GunGame_v1.0.0.phar/src/GunGame/Main
Line: #248
Error level: Error
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
			$event->setDeathMessage("");
$event->setDrops([]);
}
$event->getPlayer()->addTitle("§c ✘");
$player = $event->getPlayer();
$player->getLevel()->addSound(new AnvilFallSound($player));
$cause = $player->getLastDamageCause();
if ($cause instanceof EntityDamageByEntityEvent) {
$damager = $cause->getDamager();
$damager->getLastDamageCause();
if ($damager instanceof Player) {
$damager->getPlayer()->addTitle("§a ✔ \n " . $player->getName());
$damager->getPlayer()->addSubTitle("§b +1 Coin");
$coin = Item::get(371, 0, 1);
$coin->setCustomName("§r§l§6Coin");
$coin->setLore(["§r§2Verwende den Coin im Shop oder bei einem Special Blocks"]);
$damager->getInventory()->addItem($coin);
$event->setDeathMessage("§c Der Spieler §b" . $player->getName() . "§c wurde von §b" . $damager->getName() . "§c Getötet!");
$effect = new EffectInstance(Effect::getEffect(10), 150, 30, false);
$damager->addEffect($effect);
#0 src/pocketmine/plugin/MethodEventExecutor(42): GunGame\Main->Tot(object pocketmine\event\player\PlayerDeathEvent)
#1 src/pocketmine/plugin/RegisteredListener(80): pocketmine\plugin\MethodEventExecutor->execute(object GunGame\Main, object pocketmine\event\player\PlayerDeathEvent)
#2 src/pocketmine/event/Event(88): pocketmine\plugin\RegisteredListener->callEvent(object pocketmine\event\player\PlayerDeathEvent)
#3 src/pocketmine/Player(3787): pocketmine\event\Event->call()
#4 src/pocketmine/entity/Living(605): pocketmine\Player->onDeath()
#5 src/pocketmine/Player(3776): pocketmine\entity\Living->kill()
#6 plugins/GunGame_v1.0.0.phar/src/GunGame/Main(108): pocketmine\Player->kill()
#7 src/pocketmine/plugin/MethodEventExecutor(42): GunGame\Main->onMove(object pocketmine\event\player\PlayerMoveEvent)
#8 src/pocketmine/plugin/RegisteredListener(80): pocketmine\plugin\MethodEventExecutor->execute(object GunGame\Main, object pocketmine\event\player\PlayerMoveEvent)
#9 src/pocketmine/event/Event(88): pocketmine\plugin\RegisteredListener->callEvent(object pocketmine\event\player\PlayerMoveEvent)
#10 src/pocketmine/Player(1662): pocketmine\event\Event->call()
#11 src/pocketmine/Player(1776): pocketmine\Player->processMostRecentMovements()
#12 src/pocketmine/level/Level(852): pocketmine\Player->onUpdate(integer 26735)
#13 src/pocketmine/level/Level(785): pocketmine\level\Level->actuallyDoTick(integer 26735)
#14 src/pocketmine/Server(2267): pocketmine\level\Level->doTick(integer 26735)
#15 src/pocketmine/Server(2398): pocketmine\Server->checkTickUpdates(integer 26735, double 1601147856.5289)
#16 src/pocketmine/Server(2154): pocketmine\Server->tick()
#17 src/pocketmine/Server(1994): pocketmine\Server->tickProcessor()
#18 src/pocketmine/Server(1588): pocketmine\Server->start()
#19 src/pocketmine/PocketMine(273): pocketmine\Server->__construct(object BaseClassLoader, object pocketmine\utils\MainLogger, string[14] /root/GunGame/, string[22] /root/GunGame/plugins/)
#20 src/pocketmine/PocketMine(304): pocketmine\server()
#21 (11): require(string[69] phar:///root/GunGame/PocketMine-MP.phar/src/pocketmine/PocketMine.php)

Loaded Plugins

  • Show

Server Settings

  • Show

Installed Composer Dependencies