Hey, Does anyone know how to get a block in this case a enderchest and removing as soon as it's placed and it does something? Can you provide me some code?
Easy, just cancel the BlockPlaceEvent if the player placed an Ender Chest: PHP: public function onBlockPlace(BlockPlaceEvent $event) { $player = $event->getPlayer(); $block_id = $block->getId(); // gets the placed block’s ID if($block_id === 130) { // if player placed 130 ( = Ender Chest) $event->setCancelled(); // cancel the event. $player->sendMessage("<message>"); // send the player a message, for example // some more code }}