Skip to content

Commit 838fff2

Browse files
committed
Fix console error spam when path length is less than 3
1 parent 770909e commit 838fff2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main/java/adhdmc/nerffarms/listener/MobDamageListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ private boolean checkPath(EntityDamageByEntityEvent event, Entity entity, Persis
378378
checkDamageThreshold(mobPDC, entity);
379379
return true;
380380
}
381-
if (!CheckUtils.getBlockAbove(pathPoints.get(2), entity).isPassable()) {
381+
if (pathLength >= 3 && !CheckUtils.getBlockAbove(pathPoints.get(2), entity).isPassable()) {
382382
NerfFarms.debugLvl2("Entity does not have a path to the player (3rd path point is blocked). Returning true");
383383
addPDCDamage(event, mobPDC, hitDamage);
384384
checkDamageThreshold(mobPDC, entity);

0 commit comments

Comments
 (0)