The bug
Relates to MC-174716. Villagers killed by any causes would make all illagers and witches in an ongoing raid celebrate though they didn't even kill them on their own.
How to reproduce
Cause a raid
Wait for the raiders to approach the village
Kill all villagers and iron golems
→ ❌ All the raiders celebrate
Linked issues
relates to 1
Comments 3
oh crap theres suposed to be spacing in the code but i guess that didnt work :/ sorry hopfully its still readable.
All the code will be colored red.
its most likely a simple check in the code something along the lines like this:
{color:red} raid = "true" while raid = "true": if villagersleft = 0: raid = false (code for celebrating here) else: raid = "true" {color}
the illagers only care if the villagers are dead what the code should look like if Mojang wanted the illagers to only celebrate if they themselves kill all the villagers the code would look something like this:
{color:red} raid = "true" villagerkilled = "false" villagerkilledbyillager = 0 villagersleft = 24 totalvillagers = villagersleft illagerkills = 0 while raid = "true": if villagerkilled = "true": villagersleft = villagersleft - 1 if villagerkilledbyillager = "true": illagerkills = illager kills +1 if villagersleft = 0: if illagerkills = totalvillagers (code for illager celebration here) raid = false else: raid = true {color}
Keep in mind this code is HIGHLY unoptomized and is very slow. its also in Python 3 instead of Javascrip because I dont know enough of java to write that out but still the basic consept still applys. So, what is happening here is when ever a villager is killed, the game keeps track of the number of villagers left and how many the illagers have killed and then after all the villagers have been killed, it checks if all the villagers where killed by the illagers. If this is true the game then runs the code for the illagers celebrating, otherwise, it just ends the raid without any celebration.
I hope this makes sence to you and gives you an idea on how to fix it. You'd need to be able to code in Javascript and be able to compile it for minecraft as a mod if you plan on trying to fix it yourself anyway :/