mojira.dev
MC-247440

Raiders cannot pick up ominous banner if leader is removed from raid without dying

What Happened

  • Raider can pick up ominous banner item dropped from anywhere(player in any gamemode/chests/mob loot/etc.) after leader's death.

  • But raiders can't pick up ominous banner if the leader is removed not because of death.

Expected Behavior

  • Raiders can pick up ominous banners if the leader is removed for any reason. Or any intention the game designer wishes to reach.

Attachment

[media]

shows raiders can correctly pick up ominous banner items after leader's death.

Attachment

[media]

shows raiders can't pick up ominous banner item(but still pathfind to it) if the leader is removed not because of death.

This is because removeFromRaid() method only updates groupRaiderMap but leaders are stored in groupToLeaderMap.

// net.minecraft.world.entity.raid.Raid
public void removeFromRaid(Raider raider, boolean bl) {
    boolean bl2;
    Set<Raider> set = this.groupRaiderMap.get(raider.getWave());
    if (set != null && (bl2 = set.remove(raider))) {
        if (bl){
             this.totalHealth -= raider.getHealth(); 
        }
        raider.setCurrentRaid(null);
        this.updateBossbar();
        this.setDirty();
    }
}

Linked issues

Attachments

Comments 7

Can confirm in 1.18.1. Additionally, if you kill the original leader when he's in another dimension, the remaining pillagers in the overworld still won't be able to pick the banner up.

Illagers cannot pick up banners dropped by the player, they only pick up ones dropped by others.

@MojangMoesh

Illager can pick up banners dropped by players, see attachment

[media]

for confirmation. They only check banner items' NBT tags(patterns, custom name, etc.) so there is no difference between the one dropped by player and the one dropped by leader.

@MojangMoesh There is no behavior matches what you mentioned. Maybe the raiders are designed to behave like this, but the code doesn't go this way.

The code in this ticket is the most important part of this bug, just let someone knows well in coding check this out. I don't want to add bunches of code and point out the associattion between every lines of code here. It's useless and no one would get any information.

Can confirm in 1.14 ~ 1.18.1.

@MojangMoesh Please recheck this issue. Just launch the game and test it.

This may be related to MC-173524.
FWIW, that was reopened, and the confirmation status is 'community consensus'.
If you wish to get a bug solved next time, just point out the cause directly and put it at the beginning of an article or some will misunderstand you.

Youmiel

coschevi

Confirmed

Gameplay

Low

Raids

AI, Entities, Raid

1.18.1, 23w35a, 1.20.5 Pre-Release 4, 1.21.1, 24w39a

Retrieved