I've noticed this a couple times in the previous snapshots, but it is so hard to replicate.
I have figured out the cause of the issue and replicating it is quite easy.
The bug:
It might be intended that the Warden stops chasing a suspect if the anger value of that suspect goes below 80, but it creates very odd cases where the Warden can roar at a suspect and then stop chasing the suspect it just roared at. This happens when the anger value of a suspect just barely goes above 80 which is the threshold for making the Warden roar and chase a target.
Steps to reproduce:
Create a wool area so that vibrations can't be detected by using the command below
/fill ~-10 ~-1 ~-10 ~10 ~5 ~10 minecraft:white_wool hollow
Create a scoreboard with the commands below
/scoreboard objectives add WardenAnger dummy
/scoreboard objectives setdisplay sidebar WardenAnger
Inside of a repeating command block that is always active, enter this command.
execute as @e[type=minecraft:warden,limit=1] at @s store result score AngerLevel WardenAnger run data get entity @s anger.suspects[0].anger
Create two separate fenced areas like seen in this screenshot
[media]
Summon a Warden in one of the fenced areas and zombie in the other
Observe the Wardens behavior and anger value
Observed Results:The Warden can sometimes, very inconsistently, roar but not chase the player/mob
The suspects anger value can barely go over 80 (which is the threshold for the Warden to roar and start chasing a target), and then quickly go below 80 which causes the Warden to stop chasing the suspect it just got angry at.
All suspect data gets erased once a suspects anger value goes below 80Fixed in 22w15a
Expected Results:
The Warden will continue to chase the suspect it just got angry at for a normal period of time, and then proceed to roam once the anger value of the suspect goes below 80.
The Warden's suspect data will not be erased once the anger value of a suspect goes below 80.Fixed in 22w15a
A possible solution
A possible solution could be to set the anger value to it's maximum value once a suspects anger value goes above 80. (I believe this value is 150 because no matter how many times I hit the Warden it never goes above this value). This will cause the Warden to chase the suspect for a normal amount of time. Once the suspects anger value goes below 80, that suspect will no longer become the target and the Warden will start looking for more suspects.
Linked issues
causes 1
Attachments
Comments 10
AHAH! I found the cause of the issue! It happens when the Wardens anger level goes below 80! I'm trying to set up a repeating command block that will just grab the Wardens anger value towards an entity and send it to a bossbar to show it better. It for sure happens when the anger level goes below 80 though. I'll edit the title and description
Got the bossbar to work.
/bossbar add warden_anger {"text":"Warden Anger","color":"yellow","bold":true,"underlined":false}
/bossbar set minecraft:warden_anger players @a
/bossbar set minecraft:warden_anger style notched_10
Inside of a repeating command block that is always active
execute as @e[type=minecraft:warden,limit=1] at @s store result bossbar minecraft:warden_anger value run data get entity @s anger.suspects[0].anger
Here is a video with the scoreboard. Notice how when it goes below 80, it fully resets.
[media]
I'm going to edit the steps to reproduce to my current setup. It's way easier and doesn't involve running in circles.
Sorry for editing this bug report a lot. It still hasn't been set as confirmed so I'm trying to make the issue as clear as possible.
This should be reopened because only a portion of this bug was fixed in 22w15a. What was fixed was the Warden losing it's Suspect nbt data when the anger value went below 80.
What is still bugged is that the Warden can roar at a target and then stop being angry at that target right after. Here's the bug as it currently is:
From doing the same steps to reproduce as above, here are the observed results:
The suspects anger value can barely go over 80 (which is the threshold for the Warden to roar and start chasing a target), and then quickly go below 80 which causes the Warden to stop chasing the suspect it just got angry at.
Expected Result:
The Warden will continue to chase the suspect it just got angry at for a normal period of time, and then proceed to roam once the anger value of the suspect goes below 80.
Here is a video displaying the bug.
[media]You can see that the bug where suspect data being erased has been fixed, however the Warden can still roar and then stop being angry at a target shortly after roaring.
Can also confirm this for 22w15a, Wardens will sometimes still lose track of targets they just roared at
I got it to happen again. So strange! I was running /data get entity @e[type=minecraft:warden,limit=1] anger to see it's anger level. Here's what I found
[media]It got to 85, then started decreasing rapidly. I got it to show 82, then 81 within a second. Then it stopped chasing me and the command showed it had no suspects. Here is the video I captured showing this.