Hi ich habe ein Plugin entwickelt bei dem man in einem Shop eine bestimmte Kiste bekommt. Jetzt möchte ich allerdings hinzufügen, dass wenn man die Kiste wieder abbaut, dass der Inhalt dropt aber die Kiste nicht mit dropt. Weis jemand von euch wie?
Ich habe es schon hinbekommen, dass eine Kiste nicht dropt. Aber dann dropt halt gar keine mehr.
Danke an alle im voraus
Ich habe es schon hinbekommen, dass eine Kiste nicht dropt. Aber dann dropt halt gar keine mehr.
Code:
public class BreakChest implements Listener {
@EventHandler
public void onBlockBreak(BlockBreakEvent e) {
Block block = e.getBlock();
if (block.getType() == Material.CHEST){
Chest chest = (Chest)block.getState();
block.setType(Material.AIR);
}
}
}
Danke an alle im voraus