[Server] Notice: Object of class pocketmine\item\DiamondPickaxe could not be converted to int in phar:///storage/emulated/0/PocketMine/plugins/PE_v1.0.0.phar/src/Explosive/Explosive.php on line 58 [Server] [18:03:10] [Server thread/INFO]: VineyYT left the game [Server] [18:03:10] [Server thread/INFO]: VineyYT[/10.0.0.102:41373] logged out due to timeout [Server] [18:03:10] [Server thread/INFO]: There are 0/20 players online: [Server] [18:03:10] [Server thread/INFO]:
public function onBreak(BlockBreakEvent $ev){ if($ev->getItem() == 278 && $ev->getItem()->getCustomName() == "Explosive"){ //line 58 $explosion = new Explosion($ev->getPlayer()->getPosition(), 1.5, $this); $explosion->explodeB();
You're comparing an item object to an integer, which makes php want to convert the item object to a number. (Spoiler: It fails doing so) So instead of trying to do this PHP: $ev->getItem() == 278 // this isn't good try to use that: PHP: $ev->getItem()->getId() === 278 // this is better (Yes, you can also just use ==. It's just that I prefer ===)