The bug
When a guardian deals damage to itself after removing minecraft:thorns
from the damage type minecraft:avoids_guardian_thorns
, the game will crash due to java.lang.StackOverflowError
. Note that this can also occur when two guardians mutually deal damage to each other.
How to reproduce
Install the datapack in the Attachment
/summon minecraft:guardian
Run the following command with a command block
execute as @e[type=minecraft:guardian] run damage @s 1 minecraft:generic by @s
→ The game crashes.
data/minecraft/tags/damage_type/avoids_guardian_thorns.json
{
"replace": true,
"values": []
}
Stack trace
1.19.4 Pre-release 1\: [^crash-2023-02-27_00.38.48-server.txt]
Description: Executing command block
java.lang.StackOverflowError: Executing command block
at java.base/java.util.Objects.equals(Objects.java:64)
at anu.equals(SourceFile:13)
at java.base/java.util.ImmutableCollections$Set12.contains(ImmutableCollections.java:810)
at hc$c.a(SourceFile:184)
at bek.a(SourceFile:131)
at bvu.a(SourceFile:349)
at bvu.a(SourceFile:350)
at bvu.a(SourceFile:350)
at bvu.a(SourceFile:350)
at bvu.a(SourceFile:350)
at bvu.a(SourceFile:350)
at bvu.a(SourceFile:350)
at bvu.a(SourceFile:350)
at bvu.a(SourceFile:350)
...
Confirmed.
[media]