Skip to content

Instantly share code, notes, and snippets.

@SocraticPhoenix
Last active November 28, 2015 22:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SocraticPhoenix/bfa221fc7fe1489b3547 to your computer and use it in GitHub Desktop.
Save SocraticPhoenix/bfa221fc7fe1489b3547 to your computer and use it in GitHub Desktop.
@Listener
public void onDamage(DamageEntityEvent event) {
if(this.lobby.is(event.getTargetEntity().getWorld())) {
event.setCancelled(true);
if (event.getCause().any(DamageSource.class) && event.getCause().first(DamageSource.class).get() == DamageSources.VOID && event.getTargetEntity() instanceof Player) {
event.getTargetEntity().setLocation(this.lobby.getSpawn());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment