The constructor is undefined #2012
-
The constructor ZombieAttackGoal(WrogglerEntity, double, boolean) is undefinedJava(134217858)This is the error I'm having, I've tried a few things and it still didn't work. This is the part where I try to give it the "ZombieAttackGoal" so it would attack the player, it didn't work (it gave me the error in the first sentence), so I changed it to "WrogglerAttackGoal" and added some code below to try to make it work. protected void initCustomGoals() {
this.goalSelector.add(2, new WrogglerAttackGoal(this, 1.0D, false)); //This is the attack goal
this.goalSelector.add(7, new WanderAroundFarGoal(this, 1.0D));
this.targetSelector.add(2, new FollowTargetGoal<>(this, PlayerEntity.class, true));
this.targetSelector.add(3, new FollowTargetGoal<>(this, MerchantEntity.class, false));
this.targetSelector.add(3, new FollowTargetGoal<>(this, IronGolemEntity.class, true));
} This is the code I added, however it still creates the exact same error. static class WrogglerAttackGoal extends ZombieAttackGoal {
public WrogglerAttackGoal(WrogglerEntity wroggler, double speed, boolean pauseWhenMobIdle) {
super(wroggler, speed, pauseWhenMobIdle); //Error in first sentence happens here again
}
} |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Your code
Super constructor
WrogglerEntity is not a ZombieEntry i.e. Try making a copy of the ZombieAttackGoal class with ZombieEntity replaced with WrogglerEntity. |
Beta Was this translation helpful? Give feedback.
-
Instead of ZombieAttackGoal, I decided to use MeleeAttackGoal and it worked. |
Beta Was this translation helpful? Give feedback.
Instead of ZombieAttackGoal, I decided to use MeleeAttackGoal and it worked.