Skip to content

Instantly share code, notes, and snippets.

@TimWolla
Created June 30, 2011 13:27
Show Gist options
  • Select an option

  • Save TimWolla/1056232 to your computer and use it in GitHub Desktop.

Select an option

Save TimWolla/1056232 to your computer and use it in GitHub Desktop.
package de.evilco.regainhealthexample;
import org.bukkit.event.entity.EntityListener;
import org.bukkit.event.entity.EntityRegainHealthEvent;
public class ExampleEntityListener extends EntityListener {
public void onEntityRegainHealth(EntityRegainHealthEvent event) {
if (((org.bukkit.craftbukkit.entity.CraftPlayer) event.getEntity()).getHandle().ticksLived % 20 * 12 == 0)
event.setCancelled(true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment