PHP: public function onDamage(EntityDamageEvent $event) { $cause = $event->getCause(); if($cause === EntityDamageEvent::CAUSE_BLOCK_EXPLOSION || $cause === EntityDamageEvent::CAUSE_ENTITY_EXPLOSION){ $event->setCancelled(true); } } I'm not sure if it's explosion by entity or by block. For instant explode Summon PrimedTNT and remove the tnt when a player place a tnt. And execute explode from PrimedTNT
It should be by block if I'm not wrong Also if you want the players to still be knocked around it's better to set the damage to 0 rather than cancel the event outright