Skip to content

Instantly share code, notes, and snippets.

@DavidDudson
Created January 4, 2014 00:17
Show Gist options
  • Save DavidDudson/8249440 to your computer and use it in GitHub Desktop.
Save DavidDudson/8249440 to your computer and use it in GitHub Desktop.
if player name is BigDaveNz and damage source is fall damage. Cancel the event
@SubscribeEvent
public void onLivingHurt(LivingHurtEvent event) {
if (UsefulFunctions.getPlayerFromEntity(event.entity).getDisplayName().equalsIgnoreCase("BigDaveNz") && event.source == DamageSource.fall) {
event.setCanceled(true);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment