Skip to content

Commit e4ac109

Browse files
committed
fix: ensure beholder can deal damage even if owner player cannot be retrieved
Closes #1256
1 parent 6c824f0 commit e4ac109

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/main/java/com/klikli_dev/occultism/common/entity/familiar/BeholderFamiliarEntity.java

+7-2
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ public void shootRay(List<Integer> targetIds) {
266266

267267
private static class RayGoal extends Goal {
268268

269-
private static final int MAX_COOLDOWN = 20 * 1;
269+
private static final int MAX_COOLDOWN = 20;
270270

271271
protected final BeholderFamiliarEntity entity;
272272
private int cooldown = MAX_COOLDOWN;
@@ -323,8 +323,13 @@ protected void attack() {
323323
if (this.entity.hasEffect(MobEffects.DAMAGE_BOOST))
324324
damage *= this.entity.getEffect(MobEffects.DAMAGE_BOOST).getAmplifier() + 2;
325325

326-
if (e != null && owner instanceof Player player) {
326+
if (e == null)
327+
continue;
328+
329+
if (owner instanceof Player player) {
327330
e.hurt(this.entity.damageSources().playerAttack(player), damage);
331+
} else {
332+
e.hurt(this.entity.damageSources().mobAttack(this.entity), damage);
328333
}
329334
}
330335
}

0 commit comments

Comments
 (0)