Advertisement
Guest User

Untitled

a guest
Oct 29th, 2017
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.66 KB | None | 0 0
  1. package lolmod.entitys;
  2.  
  3. import net.minecraft.entity.EntityCreature;
  4. import net.minecraft.world.World;
  5.  
  6. public class EntityNeutral extends EntityCreature {
  7.  
  8.     private int patienceBar;
  9.    
  10.     public EntityNeutral(World worldIn) {
  11.         super(worldIn);
  12.         this.patienceBar=100;
  13.     }
  14.  
  15.     public int getPatienceBar() {
  16.         return patienceBar;
  17.     }
  18.    
  19.     @Override
  20.     public void onLivingUpdate() {
  21.         super.onLivingUpdate();
  22.         if(this.patienceBar>0 && this.getDistance(this.getHomePosition().getX(), this.getHomePosition().getY(), this.getHomePosition().getZ())>5)
  23.             this.patienceBar--;
  24.     }
  25.  
  26.     public void setPatienceBar(int patienceBar) {
  27.         this.patienceBar = patienceBar;
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement