The floating eye's passive gaze attack causes paralysis with a 2⁄3 chance every time that you attack it in melee (unless that attack kills 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, you will not be paralyzed. The DevTeam does not consider the lack of any warnings about hitting a floating eye to be a bug, and the encyclopedia entry warns even unspoiled players of the danger.
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.
Nonetheless, ranged weapons, polearms, or spells will suffice to handle a floating eye; in lieu of a powerful ranged attack, you can also 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.
Applying an item such as a blindfold or a cream pie will render the floating eye easy to kill. Another option is to make it invisible, usually by zapping it with a wand; cancelling the floating eye also renders it harmless. While you can apply a mirror to paralyze a floating eye, this does not prevent it from paralyzing you.
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 may then have to contend with hunger instead.
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) monsters to appear and kill a character.
In FIQHack, floating eyes have an area of effect slowing attack. Hitting one in melee will not paralyze you, but will cause you to accumulate an even longer duration of being slow which will typically last past leaving its slowing area of effect (or killing the floating eye).
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.
In UnNetHack, floating eyes use a different glyph, e.
In xNetHack, floating eyes use e in order to improve visibility.
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.