Minecraft wiki entry for Combat, associated text: Guardians also have spikes on their bodies. Although these spikes don't do any direct damage upon contact or as a melee attack, they act similar to the Thorns enchantment. The guardians can extend and retract their spikes. If a player attacks the guardian when its spikes are extended, the player takes a small amount of damage if attacking the guardian with a melee strike.