Guardian

The Guardian is a hostile mob which only spawns underwater, in Water Dungeons. Its eye will always look toward the camera. It also has a larger grey mini-boss variant called the Elder Guardian.

The Guardian attacks by sending out a large laser beam which harms the player. In addition, Guardians can target and damage players who are riding in boats; however once the player is out of range, the Guardian's laser will disengage from the player, and deal no damage.

Behavior
Guardians will swim around in water, attacking any players or squids that come into sight. They swim in abrupt charges, moving their tail rapidly when doing so. Unlike squids, Guardians will not die outside of water, instead they will jump and flail around, making wet, squishy noises. They will quickly move towards the nearest water source, at which point they swim away. When swimming, their spikes retract and they don't deal damage when attacked. Guardians are also resistant to lava and fire. When not swimming they sink.

Guardians' eyes will follow and stare at any nearby players, and will always look directly at who they're attacking. This makes them the first mob with dynamic eyes.

Attacking
The Guardian has two methods of attack, firing its laser and a thorn-like attack. The laser takes several seconds to charge, doing no damage in the meantime, and changing from purple to bright yellow. Once charged, the beam abruptly ends and deals damage. The Guardian 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, but can be obstructed by solid blocks.

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.

Combat
Guardians are very resistant to melee attacks when under water, as the player will not be able to quickly approach the Guardian due to the water's slowing effect. Guardians will swim away when approached by a player it is targeting, and the Guardian will deal 1 heart of damage every time it is hit when its spikes are extended. If cornered, the Guardian will usually extend its spikes and fire at the player, even at point blank range.

The Guardians are resistant to fire damage, but if somehow brought on land, they sometimes take fall damage from their swift movement.

If the player(s) must fight a Guardian in melee, they should try to corner it and hope for the best; or else try to trick it into swimming within melee range repeatedly.

The Guardian cannot shoot as fast as a player with a bow can, so a skilled player will be able to shoot the Guardian, and then hide to break the beam's lock, repeating until the Guardian is dead. If the Guardian is in shallow water the player(s) can use a fishing rod to pull it out of the water where the player(s) can then kill it using melee attacks without being shot at or hurt by the spikes.

Fighting Guardians is incredibly dangerous without armor. Armor is essential to combating Guardians, especially within the Water Dungeons. Entering their territory without armor will almost always lead to a swift death, even if armed with a sword or bow and arrow.

Farming
Guardians can be killed by iron golems if you take them out of water. A guardian farm is shown in the following video: