menu
#4531417 Call to a member function getItemInOffHand() 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:04:53 +0000 UTC

System Information

PHP version: 7.3.19
Operating system: win
System banner: Windows NT LAPTOP-SRJN8N4H 10.0 build 18362 (Windows 10) AMD64

Error information

Warning: the Offhand plugin was directly involved in this crash. Please contact the plugin author.
Message: Call to a member function getItemInOffHand() on null
File: plugins/OffHand_dev-8.phar/src/alvin0319/OffHand/OffHand
Line: #72
Error level: Error
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82

private function loadInventory(Player $player) : void{
$player->addWindow($this->getOffHandInventory($player), ContainerIds::OFFHAND, true);
if($player->namedtag->hasTag("OffHand", CompoundTag::class)){
$this->getOffHandInventory($player)->setItemInOffHand(Item::nbtDeserialize($player->namedtag->getCompoundTag("OffHand")));
}
}

private function saveInventory(Player $player) : void{
$player->namedtag->setTag($this->getOffHandInventory($player)->getItemInOffHand()->nbtSerialize(-1, "OffHand"));
unset($this->inventories[$player->getName()]);
}

public function onDataPacketReceive(DataPacketReceiveEvent $event) : void{
$packet = $event->getPacket();
$player = $event->getPlayer();
if($packet instanceof MobEquipmentPacket){
if($packet->windowId === ContainerIds::OFFHAND){
$inv = $this->getOffHandInventory($player);
if($inv instanceof OffHandInventory){
#0 plugins/OffHand_dev-8.phar/src/alvin0319/OffHand/OffHand(61): alvin0319\OffHand\OffHand->saveInventory(object pocketmine\Player)
#1 src/pocketmine/plugin/MethodEventExecutor(42): alvin0319\OffHand\OffHand->onPlayerQuit(object pocketmine\event\player\PlayerQuitEvent)
#2 src/pocketmine/plugin/RegisteredListener(80): pocketmine\plugin\MethodEventExecutor->execute(object alvin0319\OffHand\OffHand, object pocketmine\event\player\PlayerQuitEvent)
#3 src/pocketmine/event/Event(88): pocketmine\plugin\RegisteredListener->callEvent(object pocketmine\event\player\PlayerQuitEvent)
#4 src/pocketmine/Player(3643): pocketmine\event\Event->call()
#5 src/pocketmine/network/mcpe/RakLibInterface(176): pocketmine\Player->close(object pocketmine\lang\TranslationContainer, string[21] Internal server error)
#6 vendor/pocketmine/raklib/src/server/ServerHandler(95): pocketmine\network\mcpe\RakLibInterface->handleEncapsulated(string[15] 127.0.0.1 49442, object raklib\protocol\EncapsulatedPacket, integer 0)
#7 src/pocketmine/network/mcpe/RakLibInterface(109): raklib\server\ServerHandler->handlePacket()
#8 src/pocketmine/network/mcpe/RakLibInterface(99): pocketmine\network\mcpe\RakLibInterface->process()
#9 vendor/pocketmine/snooze/src/SleeperHandler(123): pocketmine\network\mcpe\RakLibInterface->pocketmine\network\mcpe\{closure}()
#10 vendor/pocketmine/snooze/src/SleeperHandler(85): pocketmine\snooze\SleeperHandler->processNotifications()
#11 src/pocketmine/Server(2157): pocketmine\snooze\SleeperHandler->sleepUntil(double 1600236293.0401)
#12 src/pocketmine/Server(1994): pocketmine\Server->tickProcessor()
#13 src/pocketmine/Server(1588): pocketmine\Server->start()
#14 src/pocketmine/PocketMine(273): pocketmine\Server->__construct(object BaseClassLoader, object pocketmine\utils\MainLogger, string[34] C:\Users\bimag\Downloads\SKYBLOCK\, string[42] C:\Users\bimag\Downloads\SKYBLOCK\plugins\)
#15 src/pocketmine/PocketMine(304): pocketmine\server()
#16 (11): require(string[89] phar://C:/Users/bimag/Downloads/SKYBLOCK/PocketMine-MP.phar/src/pocketmine/Pocke)

Loaded Plugins

  • Show

Server Settings

  • Show

Installed Composer Dependencies