bootscreen

CustomMob

Apr 17th, 2012
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.70 KB | None | 0 0
  1. package com.msingleton.templecraft.util;
  2.  
  3. import org.bukkit.Location;
  4. import org.bukkit.entity.LivingEntity;
  5.  
  6. public class CustomMob{
  7.  
  8.     private LivingEntity entity;
  9.     private int health;
  10.    
  11.     public CustomMob(LivingEntity entity)
  12.     {
  13.         this.entity = entity;
  14.     }
  15.  
  16.     public void setHealth(int health)
  17.     {
  18.         this.health = health;
  19.     }
  20.     public int getHealth()
  21.     {
  22.         return health;
  23.     }
  24.    
  25.     public void damage(int value)
  26.     {
  27.         health -= value;
  28.         if (health <= 0) {
  29.             entity.damage(entity.getMaxHealth());
  30.         }
  31.     }
  32.    
  33.     public Location getLocation()
  34.     {
  35.         return entity.getLocation();
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment