@EventHandler(priority=EventPriority.NORMAL)
public void IceBlockAbschiesen(PlayerInteractEvent event) {
if(event.getAction() == Action.RIGHT_CLICK_AIR) {
Player p = event.getPlayer();
FallingBlock block = event.getPlayer().getWorld().spawnFallingBlock(event.getPlayer().getLocation(), Material.STONE, (byte) 0);
block.setVelocity(p.getLocation().getDirection().multiply(3));
block.setDropItem(false);
}
}
@EventHandler
public void onEntityChangeBlock(EntityChangeBlockEvent e){
if(e.getEntityType() == EntityType.FALLING_BLOCK){
FallingBlock fb = (FallingBlock) e.getEntity();
if(fb.getMaterial() == Material.STONE){
e.getBlock().setTypeId(0);
}
}
}