@EventHandler public void onEntityDamageEvent(EntityDamageEvent event) { if (Lobby.get().isLobbyEnabled()) { if (event.getCause() == EntityDamageEvent.DamageCause.VOID) { Entity entity = event.getEntity(); if (entity != null) { entity.teleport(Settings.get().getLobbyLocation()); } } event.setCancelled(true); } }
@EventHandler public void onPlayerSpawnLocation(PlayerSpawnLocationEvent event) { if (Lobby.get().isLobbyEnabled()) { event.setSpawnLocation(Settings.get().getLobbyLocation()); } }