Error: "Undefined property: pocketmine\network\mcpe\protocol\InventoryTransactionPacket::$transactionType" (EXCEPTION) in "pmsrc/src/pocketmine/network/mcpe/protocol/DataPacket" at line 195 #0 plugins/VortexCore/src/core/entity/npc/NPCListener(75): pocketmine\network\mcpe\protocol\DataPacket->__get(string[15] transactionType) LINE 75: PHP: [/B][/U][/B][B][U][B]if($pk instanceof InventoryTransactionPacket and $pk->transactionType === InventoryTransactionPacket::TYPE_USE_ITEM_ON_ENTITY) { PHP: public function onDataPacketReceive(DataPacketReceiveEvent $event): void { $pk = $event->getPacket(); $player = $event->getPlayer(); if(!$player instanceof VortexPlayer) { return; } if($pk instanceof InventoryTransactionPacket and $pk->transactionType === InventoryTransactionPacket::TYPE_USE_ITEM_ON_ENTITY) { $npc = $this->core->getEntityManager()->getNPC($pk->trData->entityRuntimeId); if($npc === null) { return; } $callable = $npc->getCallable(); $callable($player); }}
PHP: if($pk instanceof InventoryTransactionPacket and $pk->trData->getTypeId() === InventoryTransactionPacket::TYPE_USE_ITEM_ON_ENTITY) { $npc = $this->core->getEntityManager()->getNPC($pk->trData->getEntityRuntimeId()); if($npc === null) { return; } $callable = $npc->getCallable(); $callable($player);} Reference: https://github.com/pmmp/PocketMine-.../mcpe/protocol/InventoryTransactionPacket.php https://github.com/pmmp/PocketMine-.../protocol/types/inventory/TransactionData.php https://github.com/pmmp/PocketMine-.../inventory/UseItemOnEntityTransactionData.php