Ported entities to 26.1.x#2640
Conversation
|
|
||
| @Override | ||
| public void doPostHurtEffects(LivingEntity target) { | ||
| if (this.parentArrow != null) { |
There was a problem hiding this comment.
Going to leave this snippet here as a potential replacement for the removed behavior:
@Override
public void doPostHurtEffects(LivingEntity target) {
if (this.parentArrow != null) {
if (this.parentArrow instanceof Arrow arrow) {
arrow.getPotionContents().forEachEffect(
effect -> target.addEffect(effect, arrow.getEffectSource()),
arrow.getPotionDurationScale()
);
}
if (this.parentArrow instanceof SpectralArrow spectralArrow) {
target.addEffect(
new MobEffectInstance(MobEffects.GLOWING, spectralArrow.duration, 0),
spectralArrow.getEffectSource()
);
}
}
super.doPostHurtEffects(target);
}It would require widening the visibility of getPotionContents(), getPotionDurationScale(), and duration. It also has the drawback of only applying effects for these two types of arrows. Another option could be a mixin accessor(likely bytecode transformer in the case of this project) for the original method in AbstractArrow, but I think this is a lot simpler for now. The intention of this comment is to provide context for other reviewers, please do not make changes based on it until someone from the team is able to review.
|
|
||
| public static AttributeSupplier.Builder registerAttributes() { | ||
| return Mob.createMobAttributes().add(Attributes.MAX_HEALTH, 10.0D).add(Attributes.MOVEMENT_SPEED, 0.25D); | ||
| return Mob.createMobAttributes().add(Attributes.MAX_HEALTH, 10.0D).add(Attributes.MOVEMENT_SPEED, 0.25D).add(Attributes.TEMPT_RANGE, 16.0D); |
There was a problem hiding this comment.
TEMPT_RANGE is hardcoded as 10.0 in TemptGoal In 1.21.1. Also, I think it's better to use Animal.createAnimalAttributes().
There was a problem hiding this comment.
That looks right to me if we were already implicitly using 10.0 on 1.21.1.
No description provided.