SHARE
TWEET

MaggotEntity.java

a guest Sep 21st, 2019 94 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package landospuk.maggotcheesemod.entities;
  2.  
  3. import landospuk.maggotcheesemod.init.MaggotEntities;
  4. import net.minecraft.entity.CreatureEntity;
  5. import net.minecraft.entity.EntityType;
  6. import net.minecraft.entity.ai.goal.BreedGoal;
  7. import net.minecraft.entity.ai.goal.FleeSunGoal;
  8. import net.minecraft.entity.ai.goal.LookRandomlyGoal;
  9. import net.minecraft.entity.ai.goal.MeleeAttackGoal;
  10. import net.minecraft.entity.ai.goal.NearestAttackableTargetGoal;
  11. import net.minecraft.entity.ai.goal.RandomWalkingGoal;
  12. import net.minecraft.entity.ai.goal.SwimGoal;
  13. import net.minecraft.entity.ai.goal.WaterAvoidingRandomWalkingGoal;
  14. import net.minecraft.entity.passive.AnimalEntity;
  15. import net.minecraft.world.World;
  16. import net.minecraftforge.event.entity.player.AttackEntityEvent;
  17.  
  18. public class MaggotEntity extends CreatureEntity{
  19.  
  20.     @SuppressWarnings("unchecked")
  21.     public MaggotEntity(EntityType<? extends CreatureEntity> type, World worldIn)
  22.     {
  23.         super((EntityType<? extends CreatureEntity>) MaggotEntities.MAGGOT_ENTITY, worldIn);
  24.     }
  25.  
  26.     @Override
  27.     protected void registerGoals()
  28.     {
  29.         this.goalSelector.addGoal(0, new SwimGoal(this));
  30.         this.goalSelector.addGoal(0, new RandomWalkingGoal(this, 1.2d));
  31.         this.goalSelector.addGoal(0, new LookRandomlyGoal(this));
  32.         this.goalSelector.addGoal(2, new BreedGoal(this, 1.0D));
  33.         this.goalSelector.addGoal(0, new FleeSunGoal(this, 1.5d));
  34.         this.goalSelector.addGoal(0, new MeleeAttackGoal(this, 1.5d, false));
  35.         this.goalSelector.addGoal(0, new WaterAvoidingRandomWalkingGoal(this, interpTargetHeadYaw));
  36.     }
  37.    
  38.     @Override
  39.     protected void registerAttributes()
  40.     {
  41.         super.registerAttributes();
  42.        
  43.     }
  44. }
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