Hostile mob filter allows incorrect mobs to pass through.
TheDarkFlame opened this issue ยท 3 comments
I've been playing with minecolonies mod and noticed that citizens there follow rules for hostile filters as if they are hostile. This is because they are created as a MobCategory.CREATURE
I see that you are filtering based on Mob and MobCategoryMobType. It might be helpful to add in extra filters based on the MobCategory entity, specifically, CREATURE and MONSTER.
Hello, the hostile filter does not appear to check mob categories at all? Originally this code checked for the MonsterEntity interface level class marker. In the 1.18.2 port we moved over to Mojang's official class mappings and it looks like this code was incorrectly updated to check for Mob when it should be checking for the Enemy marker interface. This should mean that the filter has a bug that would allow most mobs through such as horses and fish as well?
Apologies, meant that your filter is using Mob and MobType (not MobCategory).
I'm not running the latest build, but this bug exists in the version I am running (13.1.6), and source code suggests no changes since then.
In testing to confirm, I was able to push a sheep through the filter.
Also might be nice to add a custom entity selection, although that may require a bit more work...