Minecraft wiki entry for Guardian, associated text: Guardians deal damage each time it is hit with a melee attack while its spikes are extended, similar to the Thorns armor enchantment. If cornered, the guardian usually extends its spikes and fires at the player, even at point-blank range.