Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package landospuk.maggotcheesemod.entities;
- import landospuk.maggotcheesemod.init.MaggotEntities;
- import net.minecraft.entity.CreatureEntity;
- import net.minecraft.entity.EntityType;
- import net.minecraft.entity.ai.goal.BreedGoal;
- import net.minecraft.entity.ai.goal.FleeSunGoal;
- import net.minecraft.entity.ai.goal.LookRandomlyGoal;
- import net.minecraft.entity.ai.goal.MeleeAttackGoal;
- import net.minecraft.entity.ai.goal.NearestAttackableTargetGoal;
- import net.minecraft.entity.ai.goal.RandomWalkingGoal;
- import net.minecraft.entity.ai.goal.SwimGoal;
- import net.minecraft.entity.ai.goal.WaterAvoidingRandomWalkingGoal;
- import net.minecraft.entity.passive.AnimalEntity;
- import net.minecraft.world.World;
- import net.minecraftforge.event.entity.player.AttackEntityEvent;
- public class MaggotEntity extends CreatureEntity{
- @SuppressWarnings("unchecked")
- public MaggotEntity(EntityType<? extends CreatureEntity> type, World worldIn)
- {
- super((EntityType<? extends CreatureEntity>) MaggotEntities.MAGGOT_ENTITY, worldIn);
- }
- @Override
- protected void registerGoals()
- {
- this.goalSelector.addGoal(0, new SwimGoal(this));
- this.goalSelector.addGoal(0, new RandomWalkingGoal(this, 1.2d));
- this.goalSelector.addGoal(0, new LookRandomlyGoal(this));
- this.goalSelector.addGoal(2, new BreedGoal(this, 1.0D));
- this.goalSelector.addGoal(0, new FleeSunGoal(this, 1.5d));
- this.goalSelector.addGoal(0, new MeleeAttackGoal(this, 1.5d, false));
- this.goalSelector.addGoal(0, new WaterAvoidingRandomWalkingGoal(this, interpTargetHeadYaw));
- }
- @Override
- protected void registerAttributes()
- {
- super.registerAttributes();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement