menu
#4531420 Call to a member function getContents() 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-16 06:06:27 +0000 UTC

System Information

PHP version: 7.3.22
Operating system: linux
System banner: Linux 0f3edf22-7b44-4ddb-bba7-bcdab51c6a85 4.15.0-91-generic #92-Ubuntu SMP Fri Feb 28 11:09:48 UTC 2020 x86_64

Error information

Warning: the Offhand plugin was directly involved in this crash. Please contact the plugin author.
Message: Call to a member function getContents() on null
File: plugins/OffHand_dev-8.phar/src/alvin0319/OffHand/OffHand
Line: #104
Error level: Error
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
				$this->getOffHandInventory($event->getPlayer())->sendMobEquipmentPacket($event->getPlayer());
}
}
}

public function onDeath(PlayerDeathEvent $event) : void{
$player = $event->getPlayer();
$drops = $event->getDrops();
if(!$event->getKeepInventory()){
$drops = array_merge($drops, $this->getOffHandInventory($player)->getContents(false));
$event->setDrops($drops);
$this->getOffHandInventory($player)->clearAll();
}
}

public function getOffHandInventory(Player $player) : ?OffHandInventory{
return $this->inventories[$player->getName()] ?? null;
}
}
#0 src/pocketmine/plugin/MethodEventExecutor(42): alvin0319\OffHand\OffHand->onDeath(object pocketmine\event\player\PlayerDeathEvent)
#1 src/pocketmine/plugin/RegisteredListener(80): pocketmine\plugin\MethodEventExecutor->execute(object alvin0319\OffHand\OffHand, 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/CombatLogger.phar/src/jacknoordhuis/combatlogger/EventListener(119): pocketmine\Player->kill()
#7 src/pocketmine/plugin/MethodEventExecutor(42): jacknoordhuis\combatlogger\EventListener->onQuit(object pocketmine\event\player\PlayerQuitEvent)
#8 src/pocketmine/plugin/RegisteredListener(80): pocketmine\plugin\MethodEventExecutor->execute(object jacknoordhuis\combatlogger\EventListener, object pocketmine\event\player\PlayerQuitEvent)
#9 src/pocketmine/event/Event(88): pocketmine\plugin\RegisteredListener->callEvent(object pocketmine\event\player\PlayerQuitEvent)
#10 src/pocketmine/Player(3643): pocketmine\event\Event->call()
#11 src/pocketmine/network/mcpe/RakLibInterface(122): pocketmine\Player->close(object pocketmine\lang\TranslationContainer, string[17] client disconnect)
#12 vendor/pocketmine/raklib/src/server/ServerHandler(127): pocketmine\network\mcpe\RakLibInterface->closeSession(string[21] 112.204.241.239 53647, string[17] client disconnect)
#13 src/pocketmine/network/mcpe/RakLibInterface(109): raklib\server\ServerHandler->handlePacket()
#14 src/pocketmine/network/mcpe/RakLibInterface(99): pocketmine\network\mcpe\RakLibInterface->process()
#15 vendor/pocketmine/snooze/src/SleeperHandler(123): pocketmine\network\mcpe\RakLibInterface->pocketmine\network\mcpe\{closure}()
#16 vendor/pocketmine/snooze/src/SleeperHandler(85): pocketmine\snooze\SleeperHandler->processNotifications()
#17 src/pocketmine/Server(2157): pocketmine\snooze\SleeperHandler->sleepUntil(double 1600236387.5245)
#18 src/pocketmine/Server(1994): pocketmine\Server->tickProcessor()
#19 src/pocketmine/Server(1588): pocketmine\Server->start()
#20 src/pocketmine/PocketMine(273): pocketmine\Server->__construct(object BaseClassLoader, object pocketmine\utils\MainLogger, string[16] /home/container/, string[24] /home/container/plugins/)
#21 src/pocketmine/PocketMine(304): pocketmine\server()
#22 (11): require(string[71] phar:///home/container/PocketMine-MP.phar/src/pocketmine/PocketMine.php)

Loaded Plugins

  • Show

Server Settings

  • Show

Installed Composer Dependencies