daily pastebin goal
70%
SHARE
TWEET

Untitled

a guest Jun 17th, 2012 6,930 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package me.Adamki11s.Example;
  2.  
  3. import org.bukkit.entity.Entity;
  4. import org.bukkit.entity.Player;
  5. import org.bukkit.event.entity.EntityDamageEvent;
  6. import org.bukkit.event.Listener;
  7. import org.bukkit.event.EventHandler;
  8.  
  9. /* Example Template
  10.  * By Adamki11s
  11.  * Plugin Tutorial
  12.  */
  13.  
  14. public class ExampleEntityListener implements Listener {
  15.        
  16.         public Example plugin;
  17.        
  18.         public ExampleEntityListener(Example instance) {
  19.                 plugin = instance;
  20.         }
  21.  
  22.         @EventHandler
  23.         public void onEntityDamage(EntityDamageEvent event){
  24.                
  25.                 if(event.getEntity() instanceof Player){
  26.                 //If the entity being damaged is a player then...
  27.  
  28.                         event.setCancelled(true);
  29.                 //Cancel the damage event, this will give the player unlimited health
  30.                 }
  31.         }
  32.  
  33. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top