menu
#9718641 Call to undefined method pocketmine\player\Player::getBlock()

Submitted by PocketMine-MP 5.8.2

General information

Version: 5.8.2
Git commit: c3c81b09
Plugin involvement: Direct
Report date: 2023-12-03 04:56:48 +0000 UTC
Server uptime: 0 days 0 hours 0 minutes 58 seconds

System Information

PHP version: 8.1.25
JIT status: Not available
Operating system: linux
System banner: Linux 36da6b28-19ce-4481-9eb9-81cfb73a396b 5.4.0-163-generic #180-Ubuntu SMP Tue Sep 5 13:21:23 UTC 2023 x86_64

Error information

Warning: the PortalToggleC plugin was directly involved in this crash. Please contact the plugin author.
Thread: Main
Message: Call to undefined method pocketmine\player\Player::getBlock()
File: plugins/PortalToggleC/src/MagmaZ3637/Portal/Main
Line: #19
Type: Error
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
class Main extends PluginBase implements Listener {

public function onEnable(): void {
$this->getServer()->getPluginManager()->registerEvents($this, $this);
$this->getLogger()->info("Plugin Aktif Ya Tod");
}

public function onMove(PlayerMoveEvent $event) {
$player = $event->getPlayer();
$block = $player->getBlock($player);
if($block->getId() === PORTAL_BLOCK ) { // ganti dengan id block yang ingin kamu pantau
$this->getServer()->dispatchCommand(new ConsoleCommandSender(), "core"); // ganti dengan command yang ingin kamu jalankan
}
}
}
#0 pmsrc/src/event/RegisteredListener(61): MagmaZ3637\Portal\Main->onMove(object pocketmine\event\player\PlayerMoveEvent#104422)
#1 pmsrc/src/event/Event(63): pocketmine\event\RegisteredListener->callEvent(object pocketmine\event\player\PlayerMoveEvent#104422)
#2 pmsrc/src/player/Player(1338): pocketmine\event\Event->call()
#3 pmsrc/src/player/Player(1431): pocketmine\player\Player->processMostRecentMovements()
#4 pmsrc/src/world/World(997): pocketmine\player\Player->onUpdate(int 842)
#5 pmsrc/src/world/World(922): pocketmine\world\World->actuallyDoTick(int 842)
#6 pmsrc/src/world/WorldManager(351): pocketmine\world\World->doTick(int 842)
#7 pmsrc/src/Server(1798): pocketmine\world\WorldManager->tick(int 842)
#8 pmsrc/src/Server(1680): pocketmine\Server->tick()
#9 pmsrc/src/Server(1065): pocketmine\Server->tickProcessor()
#10 pmsrc/src/PocketMine(341): pocketmine\Server->__construct(object pocketmine\thread\ThreadSafeClassLoader#6, object pocketmine\utils\MainLogger#3, string[16] /home/container/, string[24] /home/container/plugins/)
#11 pmsrc/src/PocketMine(364): pocketmine\server()
#12 pmsrc(11): require(string[60] phar:///home/container/PocketMine-MP.phar/src/PocketMine.php)

Loaded Plugins

  • Show

Server Settings

  • Show

Installed Composer Dependencies

Installed PHP Extensions

  • Show