menu
#10623588 MyPlot\EventListener::getBlockFromEvent(): Argument #1 ($event) must be of type pocketmine\event\block\BlockEvent, pocketmine\event\player\PlayerInteractEvent given, called in C:\Users\DELL\Desktop\PocketMine-MP-stable\plugins\MyPlot-API4\src\MyPlot\EventListener.php on line 155

Submitted by PocketMine-MP 5.13.0

General information

Version: 5.13.0
Git commit: f193a990
Plugin involvement: Direct
Report date: 2024-04-03 04:40:35 +0000 UTC
Server uptime: 0 days 0 hours 0 minutes 30 seconds

System Information

PHP version: 8.2.13
JIT status: Not available
Operating system: win
System banner: Windows NT JULIOM 10.0 build 19045 (Windows 10) AMD64

Error information

Warning: the MyPlot plugin was directly involved in this crash. Please contact the plugin author.
Thread: Main
Message: MyPlot\EventListener::getBlockFromEvent(): Argument #1 ($event) must be of type pocketmine\event\block\BlockEvent, pocketmine\event\player\PlayerInteractEvent given, called in C:\Users\DELL\Desktop\PocketMine-MP-stable\plugins\MyPlot-API4\src\MyPlot\EventListener.php on line 155
File: plugins/MyPlot-API4/src/MyPlot/EventListener
Line: #146
Type: TypeError
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
		$this->onEventOnBlock($event);
}

/**
* Obtiene el bloque del evento BlockEvent.
*
* @param BlockEvent $event El evento BlockEvent.
* @return Block|null El bloque asociado al evento, o null si no se puede obtener.
*/
public static function getBlockFromEvent(BlockEvent $event): ?Block {
if ($event->getBlock() !== null) {
return $event->getBlock();
} else {
return null;
}
}

private function onEventOnBlock(PlaceEvent|SignChangeEvent|PlayerInteractEvent|BlockBreakEvent $event) : void {
$levelName = self::getBlockFromEvent($event)->getPosition()->getWorld()?->getFolderName();
//$levelName = $event->getBlock()->getPosition()->getWorld()?->getFolderName();
#0 plugins/MyPlot-API4/src/MyPlot/EventListener(155): MyPlot\EventListener::getBlockFromEvent(object pocketmine\event\player\PlayerInteractEvent#114544)
#1 plugins/MyPlot-API4/src/MyPlot/EventListener(127): MyPlot\EventListener->onEventOnBlock(object pocketmine\event\player\PlayerInteractEvent#114544)
#2 pmsrc/src/event/RegisteredListener(61): MyPlot\EventListener->onPlayerInteract(object pocketmine\event\player\PlayerInteractEvent#114544)
#3 pmsrc/src/event/Event(63): pocketmine\event\RegisteredListener->callEvent(object pocketmine\event\player\PlayerInteractEvent#114544)
#4 pmsrc/src/player/Player(1746): pocketmine\event\Event->call()
#5 pmsrc/src/network/mcpe/handler/InGamePacketHandler(684): pocketmine\player\Player->attackBlock(object pocketmine\math\Vector3#114547, int 2)
#6 pmsrc/src/network/mcpe/handler/InGamePacketHandler(259): pocketmine\network\mcpe\handler\InGamePacketHandler->handlePlayerActionFromData(int 0, object pocketmine\network\mcpe\protocol\types\BlockPosition#114557, int 2)
#7 pmsrc/vendor/pocketmine/bedrock-protocol/src/PlayerAuthInputPacket(296): pocketmine\network\mcpe\handler\InGamePacketHandler->handlePlayerAuthInput(object pocketmine\network\mcpe\protocol\PlayerAuthInputPacket#114579)
#8 pmsrc/src/network/mcpe/NetworkSession(456): pocketmine\network\mcpe\protocol\PlayerAuthInputPacket->handle(object pocketmine\network\mcpe\handler\InGamePacketHandler#116273)
#9 pmsrc/src/network/mcpe/NetworkSession(394): pocketmine\network\mcpe\NetworkSession->handleDataPacket(object pocketmine\network\mcpe\protocol\PlayerAuthInputPacket#114579, string[138] ...........LaC...C.L}C..........................................................)
#10 pmsrc/src/network/mcpe/raklib/RakLibInterface(214): pocketmine\network\mcpe\NetworkSession->handleEncoded(string[99] .c.ab.Ua.:...........(....'02@...>..;.q;...uf@[email protected]....{[email protected]!t.)
#11 pmsrc/vendor/pocketmine/raklib-ipc/src/RakLibToUserThreadMessageReceiver(40): pocketmine\network\mcpe\raklib\RakLibInterface->onPacketReceive(int 0, string[108] ......x..W.......-2w>yHn]4*0.>8+...XQ.xlP.....u.........V................[..+..>)
#12 pmsrc/src/network/mcpe/raklib/RakLibInterface(107): raklib\server\ipc\RakLibToUserThreadMessageReceiver->handle(object pocketmine\network\mcpe\raklib\RakLibInterface#188445)
#13 pmsrc/src/TimeTrackingSleeperHandler(58): pocketmine\network\mcpe\raklib\RakLibInterface->pocketmine\network\mcpe\raklib\{closure}()
#14 pmsrc/vendor/pocketmine/snooze/src/SleeperHandler(120): pocketmine\TimeTrackingSleeperHandler->pocketmine\{closure}()
#15 pmsrc/src/TimeTrackingSleeperHandler(77): pocketmine\snooze\SleeperHandler->processNotifications()
#16 pmsrc/vendor/pocketmine/snooze/src/SleeperHandler(79): pocketmine\TimeTrackingSleeperHandler->processNotifications()
#17 pmsrc/src/Server(1696): pocketmine\snooze\SleeperHandler->sleepUntil(float 1712119235.4071)
#18 pmsrc/src/Server(1066): pocketmine\Server->tickProcessor()
#19 pmsrc/src/PocketMine(350): pocketmine\Server->__construct(object pocketmine\thread\ThreadSafeClassLoader#6, object pocketmine\utils\MainLogger#3, string[43] C:\Users\DELL\Desktop\PocketMine-MP-stable\, string[51] C:\Users\DELL\Desktop\PocketMine-MP-stable\plugins\)
#20 pmsrc/src/PocketMine(373): pocketmine\server()
#21 pmsrc(11): require(string[87] phar://C:/Users/DELL/Desktop/PocketMine-MP-stable/PocketMine-MP.phar/src/PocketM)

Loaded Plugins

  • Show

Server Settings

  • Show

Installed Composer Dependencies

Installed PHP Extensions

  • Show