Ported entities to 26.1.x#2640
Open
albazavr-alba wants to merge 6 commits into
Open
Conversation
a6tumn
reviewed
Jun 24, 2026
a6tumn
reviewed
Jul 17, 2026
|
|
||
| @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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.