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 CorrectBehaviour(and_banner_dropped_by_player_is_pickable).mp4 shows raiders can correctly pick up ominous banner items after leader's death.
Attachment javaw 2022-01-03 13-49-29-388_1.mp4 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(); } }