Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class DarknessZombie extends MonsterEntity{
- private static final DataParameter<Integer> DATA_SPECIAL_TYPE_ID = EntityDataManager.defineId(DarknessZombie.class, DataSerializers.INT);
- public DarknessZombie(EntityType<? extends MonsterEntity> type, World world) {
- super(type,world);
- }
- @Override
- protected void registerGoals() {
- goalSelector.addGoal(1, new SwimGoal(this));
- goalSelector.addGoal(2, new MeleeAttackGoal(this, 1, false));
- goalSelector.addGoal(7, new WaterAvoidingRandomWalkingGoal(this, 1));
- goalSelector.addGoal(8, new LookAtGoal(this, PlayerEntity.class, 8f));
- goalSelector.addGoal(8, new LookRandomlyGoal(this));
- targetSelector.addGoal(2, new HurtByTargetGoal(this));
- targetSelector.addGoal(3, new NearestAttackableTargetGoal<PlayerEntity>(this, PlayerEntity.class, true));
- addBehaviourGoals();
- }
- @Override
- protected void defineSynchedData() {
- super.defineSynchedData();
- this.getEntityData().define(DATA_SPECIAL_TYPE_ID, 0);
- }
- protected void addBehaviourGoals() {
- this.goalSelector.addGoal(7, new WaterAvoidingRandomWalkingGoal(this, 1.0D));
- this.targetSelector.addGoal(1, (new HurtByTargetGoal(this)).setAlertOthers(ZombifiedPiglinEntity.class));
- this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, PlayerEntity.class, true));
- this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, AbstractVillagerEntity.class, false));
- this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, IronGolemEntity.class, true));
- this.targetSelector.addGoal(5, new NearestAttackableTargetGoal<>(this, TurtleEntity.class, 10, true, false, TurtleEntity.BABY_ON_LAND_SELECTOR));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment