Blöcke nicht explodieren?

2 Antworten

(GEHT NICHT)@EventHandler
public void onExplode(BlockExplodeEvent e) {
    e.setCancelled(true);
    for(Block b : e.blockList()) {
        b.getWorld().getBlockAt(b.getLocation()).setType(b.getType());
        b.getWorld().getBlockAt(b.getLocation()).setData(b.getData());
    }
}

Hi! Ich habs nicht getestet, aber vllt geht es so! :D
UPDATE (FIX):

 @EventHandler
public void onEntityExplode(EntityExplodeEvent e) {
    if (e.getEntityType().equals(EntityType.PRIMED_TNT)) {
        e.setCancelled(true);
    }
}
Woher ich das weiß:eigene Erfahrung
LuLuMaster12  21.12.2019, 15:57

Hab die Welt ganz vergessen, tut mir leid. Aber ich denke du weißt wie das geht ;)

0