Quark Oddities

Quark Oddities

22M Downloads

ArrowSafeMobs can cause bad situations.

Darkhax opened this issue ยท 1 comments

commented

There are a few situations where the arrow safe mobs feature can conflict with other mods. For example, I just released the Kelpie which adds a hostile mount that tries to drown you. And other mods have used mounted entities as an attack type thing. While doing research for my mob I cam across another mod which adds a frozen ice entity that you get stuck inside of. I think there are some ways we could fix this, however I am curious if this feature is even needed, as vanilla already has code for it. The following code is from AbstractHorse

    public boolean attackEntityFrom(DamageSource source, float amount)
    {
        Entity entity = source.getTrueSource();
        return this.isBeingRidden() && entity != null && this.isRidingOrBeingRiddenBy(entity) ? false : super.attackEntityFrom(source, amount);
    }

As for a proposed solution, without removing this feature from Quark. Entity has a method called canRiderInteract which by default returns false. This method is used in the getMouseOver method, and is used to prevent melee attacking a mob you're riding. This would also be a useful check for your feature, to allow modded entities to always be hurt.

commented

I don't believe that has always been there, but I'll look into it. I'll probably end up removing the feature if it's been added to vanilla without me noticing.