Tutorials/Phantom-proofing

For players returning to the game, Phantoms can be a sudden and frightening threat. While Phantoms only begin to spawn after three sleepless nights, some want not to go to sleep every two hours, but to fend off these winged terrors head-on.
== Purpose ==
When AFK-ing at a farm, it is likely that the player would be doing so for extended periods of time. Most farms have specific requirements such as world height that makes phantoms spawn regularly. Phantoms are often considered pests since they can deal damage, knock players off of platforms, and trigger redstone components.
== Mechanics and Properties ==
They are considered “undead,” meaning that they are healed by harming potions, harmed by healing potions, burn in sunlight, and are ignored by the wither.
=== Spawning ===
Phantoms spawn at night or during a thunderstorm at light level 7 or less. They also must spawn above sea level and they ignore the hostile mob cap when spawning (despite contributing to it). They will only spawn within 20-34 blocks above the player, as long as there are no blocks to stop skylight access. After three full in-game days without sleeping, phantoms will start spawning in increasing numbers for each extra sleepless night. They do not rely on surfaces to spawn. When they spawn, they announce their presence by hissing loudly.
=== Attacking ===
When searching for a target, they hover and circle at a constant elevation. When attacking, they swoop down quickly, “bite” to deal damage, and then quickly swoop back up to their idle positions. The player is not safe underwater since water does not inhibit their movement and they cannot drown.
== Methods ==
Most methods are dedicated to preventing phantoms from spawning in the first place. However, some high-efficiency mob farms are incompatible or lose efficiency based on the method chosen.
=== Method 1: Covering ===
This is possibly the simplest solution: cover up the AFK spot with any semi-solid or fully solid block. As long as it decreases light levels, anything goes. This way, the requirement for full access to the sky is never met, allowing the player to AFK indefinitely.
Pros:
# It does not require much work
# It is extremely versatile - the roof can be any shape and any distance above the player
Cons:
# Some farms require specific places to have unobstructed sky access. The player might have to rethink where to place their AFK spot
# Normal mobs could still spawn on the chosen roof (unless you put slabs or torches on it)
=== Method 2: Underwater AFK spot ===
Even though phantoms are not inhibited by water, having an AFK spot below sea level prevents their spawning entirely.
Pros:
# An AFK spot can be placed anywhere in any biome as long as it is somewhere below sea level
# It is very easy to dig a hole just deep enough to prevent phantom spawning
Cons:
# Mob farms are most efficient if the player is 120 blocks above the spawning areas, which is impossible considering that the sea level is usually at elevation level 64
# The sea level can be lowered or negated upon world generation with custom settings, rendering this method useless
=== Method 3: Beds ===
This method requires the player to constantly right-click/tap on a bed. When possible, the player can sleep in the bed. It is possible to manipulate bed mechanics so that the player ends up in front of the bed facing it to keep right-clicking/tapping on it.
Pros:
# It prevents in-game insomnia
# It is compatible with nearly all mob farms where the previous methods could not be used
Cons:
# This is useless if the farm requires clicking to use
# Beds will not allow the player to sleep if there are hostile mobs nearby
=== Method 4: Cats ===
Phantoms try to stay at least 16 blocks away from cats. So the player can bring a cat with them when they are at a farm.
Pros:
# It is compatible with nearly all mob farms where the previous methods could not be used
Cons:
# This method only keeps Phantoms away instead of preventing phantoms from spawning
# The cat can get killed. so this method is not reliable all the time
=== Method 5: Combined Farming ===
Any AFK spot can be turned into a simple phantom farm. Like most other mobs, phantoms are helpless in bubble columns and take damage from magma blocks. Well-placed windows can lure phantoms to the player so they can be dragged down by downwards bubble columns and die on the magma blocks that create the columns. Hopper minecarts can then collect the drops.
Pros:
# By combining farms, phantom membranes can also be produced, which are useful in their own way
# It allows for phantoms to spawn without them being a nuisance
Cons:
# The player cannot guarantee total protection against phantoms
# Their spawning can make phantom farms quickly become extremely complicated
zh:教程/幻翼防护