A floating eye, e, is a monster with a passive paralyzing gaze attack makes it very dangerous if handled incorrectly. The DevTeam does not consider the lack of any warnings about hitting a floating eye to be a bug. The encyclopedia entry does warn even unspoiled players of the danger.
The floating eye has a passive gaze attack which causes paralysis. Every time you attack a floating eye with a melee attack, there is a 2⁄3 chance that it will use its gaze attack against you if your attack did not kill it. If the floating eye has been cancelled, is blind, or if you cannot see the floating eye, it cannot use its gaze attack. If you have reflection or free action, the paralysis will not affect you.
If you are paralyzed, the length of time depends on your wisdom and the floating eye's level (typically 2 or 3). If your wisdom is 12 or lower, there is a 25% chance of being paralyzed for exactly 127 turns; otherwise you are paralyzed for (lvl + 1)d70 turns.
If you are paralyzed by the floating eye's gaze, you are likely to be killed by even the weakest monsters such as newts or grid bugs. Because of this, floating eyes are the cause of many YASDs. Nonetheless, if you avoid hitting them in melee they are entirely harmless.
To kill a floating eye, it is best to use ranged weapons, polearms, or spells. If you do not have a powerful ranged attack, throw junk weapons or rocks. If you are in a room with the floating eye (rather than a corridor) and no other monsters are around, you can keep throwing your melee weapon at it and waiting for it to move so that you can retrieve your weapon. Finally, if wasting turns is not an issue, you can place yourself between the floating eye and an obstacle of some sort (such as a locked door, boulder, or passive creature) so the paralysis will cause no lasting damage other than wasting turns; however, you will then have to contend with hunger instead.
Floating eyes cannot harm you if you are blind. Thus you may kill them in melee if you just first blind yourself, for example by wearing a blindfold or towel. Blinding the floating eye is also effective, but there is a 1⁄500 chance of a −1 Luck penalty for hitting a blind floating eye. Another option is to zap it with a wand of make invisible or otherwise make it invisible, as long as you cannot see invisible.
You can apply a mirror to paralyze a floating eye, but this is not particularly useful as it will still be able to paralyze you.
In dNetHack, the duration of the paralysis effect is shortened to 2d6 turns, making them less dangerous to melee. However, it is still safest to attack them from range, as 12 turns is still enough time for other weak monsters to appear and kill a character.
In NetHack 4, it is impossible to attack a floating eye in melee without being protected from its gaze in some way. Monsters can still attack floating eyes normally and suffer paralysis. This was implemented to prevent aggravating deaths from early-game movement mistakes, as an accidental button press would often mean instant death.
UnNetHack and xNetHack
Eating a floating eye in Slash'EM Extended is not guaranteed to give telepathy. The paralysis effect from attacking them also has a much shorter time in this variant, making it much less dangerous to melee them.
Floating eyes, not surprisingly, are large, floating eyeballs
which drift about the dungeon. Though not dangerous in and
of themselves, their power to paralyse those who gaze at
their large eye in combat is widely feared. Many are the
tales of those who struck a floating eye, were paralysed by
its mystic powers, and then nibbled to death by some other
creature that lurked around nearby.