The guardian is a underwater hostile mob. It has a kind of boss which is a larger, grey, mini-boss variant called the Elder Guardian.
Guardians only spawn naturally in and around ocean monuments which are found randomly in the ocean biome. They require water if they are to spawn.
Guardians spawn less often in ocean that is open to the sky than they do in covered areas (example: inside the ocean monument). Specifically, spawning will fail 95% of the time if the spawning water block is below level Y=63, all blocks between the spawning water block and level Y=63 are liquid or fully transparent, and the block at level Y=63 has a view of the sky. Above Y=63, spawning will fail 95% of the time if the spawning water block has a view of the sky.
What they drop
Guardians can drop 0 to 1 prismarine crystals, 0 to 2 prismarine shards, and 0 to 1 raw fish.
Guardians have a 2.5% chance of dropping a rare drop when killed by the player. The chance of which fish you get is exactly the same to catching fish: 60% chance for raw fish, 25% chance for raw salmon, 2% chance for clownfish, and 13% chance for a pufferfish.
Looting increases the maximum prismarine shard drop by one per level. So the chance of getting a raw fish drop is 50% with Looting I(1) (2/4), 60% with Looting II(2) (3/5), and 67% with Looting III(3) (4/6). The chance of getting a rare drop is also increased by 0.5% per level.
The prismarine crystals drop will only happen if the common raw fish drop fails, with the same chances as the raw fish drop. This works out to a base chance of 22% (2/9), Looting I giving 25% (4/16), Looting II dropping down to 24% (6/25), and Looting III giving 22% (8/36), which is the same as the base chance.
How they attack
Guardians have two different methods of attack: a laser and a defensive thorn-like attack. Unlike most other hostile mobs, a Guardian will not follow the player if they move out of sight. Instead, it will continue swimming until the player becomes visible again and will then start to charge its attack.
Their laser takes several seconds to charge, doing no damage in the meantime and changing from purple to bright yellow. Once the beam is charges it abruptly ends and deals damage. Guardians will swim around for a few seconds before firing again. If the target comes near the guardian while it is firing its beam, it will stop firing and swim away until it is at a comfortable range, at which point it will continue attacking. The beam cannot be dodged, and has a maximum range of approximately 15 blocks. Once the player is out of range, or if the beam is obstructed by solid blocks, the guardian’s beam will disengage from the player, and deal no damage