p1ut0nium-git / Rough-Mobs-Revamped

Rough Mobs Revamped for Minecraft
https://www.curseforge.com/minecraft/mc-mods/rough-mobs-revamped
4 stars 8 forks source link

[Bug]Hostile Bats Path to Unknown Destination Without Boss Monster #51

Closed SandwichHorror closed 2 years ago

SandwichHorror commented 3 years ago

When there is no boss monster nearby, the hostile bats fly in a straight line along the ground rather than wander. I suspect it might be to [0,0] because their code is telling them to seek out fellow bats or the zombie boss, and they lack the UUID or whatever they need of their master entity.

If a hostile bat has somehow lost its master, it should just wander about like a normal bat and aggro to any valid players within its range.

p1ut0nium-git commented 2 years ago

I’ll probably make them despawn instead.

p1ut0nium-git commented 2 years ago

Actually...upon inspecting my code. The bats should despawn when the boss dies:

    @Override
    public void onDeath(DamageSource cause) {
        super.onDeath(cause);

        // Max out batSwarmTick so no more bats can spawn
        batSwarmTick = BATSWARM_DELAY;

        // Kill all bat minions when boss dies
        if (!batMinions.isEmpty() ) {
            for (EntityHostileBat bat : batMinions) {
                bat.setDead();
            }
        }
    }
p1ut0nium-git commented 2 years ago

fixed in 2.3.23