Skip to content

killaura incorrect baby filter #6088

@Nippaku-Zanmu

Description

@Nippaku-Zanmu

Describe the bug

Enabling killaura and setting mobAgeFilter to Baby will still attack adult mobs.

This is due to an incorrect instance check in killaura's mobAgeFilter.

if (entity instanceof AnimalEntity animal) { return switch (mobAgeFilter.get()) { case Baby -> animal.isBaby(); case Adult -> !animal.isBaby(); case Both -> true; }; }

AnimalEntity inherits from LivingEntity, and the isBaby function has already been declared in LivingEntity.

Steps to reproduce

  1. Use spawn eggs to generate one baby and one adult zombie
  2. Set killaura's mobAgeFilter to baby
  3. Enable killaura
  4. It will attack all zombies

Meteor Version

1.21.11#48

Minecraft Version

1.21.11

Operating System

Windows

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).

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