Skip to content

passive-mob-age-filter setting in KillAura has no effect #6608

Description

@hokindo9000

Describe the bug

In KillAura.java's entityCheck() method, the passive mob age filter check
computes a result but never uses it:

if (entity instanceof AgeableMob && (!(entity instanceof Frog || entity instanceof Parrot))) {
    passiveMobAgeFilter.get().test(livingEntity);
}
return true;

Compare this to the hostile mob filter directly above it, which correctly
returns the test result:

if (entity instanceof Zombie || entity instanceof Piglin
    || entity instanceof Hoglin || entity instanceof Zoglin) {
    return hostileMobAgeFilter.get().test(livingEntity);
}

Because the passive mob branch is missing the return keyword, the boolean
result of .test(livingEntity) is computed and immediately thrown away. Code
execution always falls through to the final return true; at the end of
the method regardless of the test's outcome.

`
The "passive-mob-age-filter" setting (Adult / Baby / Both) is completely
non-functional for all passive mobs (animals, villagers) except Frog and
Parrot (which are explicitly excluded from this check anyway). Users who
set this filter to "Adult" expecting KillAura to ignore baby animals will
still have KillAura attack baby animals, since the filter result is never
actually applied.

Steps to reproduce

  1. Enable KillAura.
  2. Add a passive mob type (e.g. Cow, Pig) to the "entities" targeting list.
  3. Set "passive-mob-age-filter" to "Adult".
  4. Stand near a baby version of that mob.
  5. Observe that KillAura still attacks the baby mob, even though the
    filter is set to only allow adults.

Meteor Version

26.1.2-42

Minecraft Version

26.1.2

Operating System

Linux

Before submitting a bug report

  • This bug wasn't already reported (I have searched bug reports on GitHub).

  • This is a valid bug (I am able to reproduce this on the latest dev build).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions