Когда хочу взорвать Вагонетку с ТнТ(с лука) то земля тоже должен вроде взорватся но что то не так, как исправить?
Я пробывал поставить “$explosion->explodeC();” но че то не пашет
$entity = $event->getEntity();
if(!($entity instanceof MinecartTNT)){
return;
}
$event->setCancelled();
if($event instanceof EntityDamageByEntityEvent and !($event instanceof EntityDamageByChildEntityEvent)){
$entity->setMotion($event->getDamager()->getDirectionVector()->multiply(self::MOTION_POWER));
return;
}
if($event instanceof EntityDamageByChildEntityEvent){
$explosion = new Explosion($entity->asPosition(), self::EXPLOSION_POWER);
$explosion->explodeB();
$entity->despawnFromAll();
$entity->kill();
$entity->close();