Difficulty



Difficulty is an option in Minecraft that has a direct impact on the ease of gameplay, allowing the game's challenges to be tailored to the player's skill level.

World settings


There are four difficulty levels in the game: Peaceful, Easy, Normal and Hard. These can be changed when creating a world, in the settings, as well as with the command.

Peaceful
No hostile mobs can spawn naturally, except for shulkers, hoglins, zoglins, piglin brutes, and the ender dragon. No mobs can deal damage to player in peaceful. No spiders, cave spiders, zombified piglins or endermen – neutral rather than hostile mobs – can spawn naturally. When any of these mobs attempt to spawn (whether naturally, through mob spawners, spawn eggs, or commands), they are removed from the game instantaneously. When the difficulty is switched from any other setting to Peaceful, all mobs that are not allowed to spawn on Peaceful are removed from the world. Players regain health rapidly over time. Despite this, it is still possible to die if damage is received quickly enough. TNT deals no direct damage to the player, but it does give knockback still, meaning a player can be killed by it if it launches them too far upward. The hunger bar never depletes; $$, players therefore cannot eat anything except golden apples, chorus fruits, and milk buckets, unless the player switched to Peaceful when their hunger bar was below the maximum. Players can eat normally $$. Additionally, if the hunger bar is below the maximum, it regenerates quickly.

End portals cannot be activated by the player in Peaceful difficulty, because it is impossible to acquire the twelve eyes of ender necessary to activate an end portal. However, it is possible for an end portal to be activated by naturally generating with an eye of ender already embedded within all 12 end portal frames. For any given end portal, there is only a 1 in a trillion chance of this happening. However, because of the huge number of possible seeds, over 8 million seeds $1⁄10$ are known to generate such end portals.

Also, not all advancements / achievements can be completed in Peaceful difficulty.

Easy
Hostile mobs spawn, but they deal less damage than on Normal difficulty. The hunger bar can deplete, damaging the player until they are left with if it drains completely. Cave spiders and bees cannot poison players on Easy difficulty, and the wither does not cause the Wither effect, although wither skeletons do. Lightning sets only the struck block on fire, not surrounding blocks. Zombies do not break down doors, and do not turn villagers into zombie villagers. Zombies and skeletons don't wear full sets of armor. Hostile mobs like zombies, skeletons, spiders, husks and strays deal about or  damage.

Normal
Hostile mobs spawn and deal standard damage, about or. The hunger bar can deplete, damaging the player until they are left with with if it drains completely. Zombies do not break down doors, but villagers killed by zombies have a 50% chance of turning into zombie villagers. Zombies and skeletons rarely wear sets of enchanted armor. Vindicators can break doors.

Hard
Hostile mobs deal more damage than on Normal difficulty. The hunger bar can deplete, damaging the player until they die if it drains completely. Zombies can break through wooden doors and can spawn reinforcements when attacked. Spiders can spawn with a beneficial status effect (speed, strength, regeneration & invisibility), with these effects having a nearly infinite duration $1⁄10$. Villagers killed by zombies always turn into zombie villagers. Pillagers spawn near the player, with their attacks dealing damage. $1⁄1 trillion$, if the world type is infinite, they deal damage.

Hardcore mode


In Java edition, at the world creation screen, selecting Hardcore from among the game mode options causes the player to spawn in Hard difficulty, does not allow it to be changed, and allows the player only one life. In a single player world, a player who dies can choose to respawn in Spectator mode or return to the title screen. In multiplayer, upon death, the player's game mode is automatically set to Spectator mode.

The only way to change the difficulty of Hardcore is to use the Open to LAN feature in the pause menu to enable commands, or to use an .NBT editor on the world's .NBT file.

This difficulty is currently not available in Realms.

Moon phase
The phase of the moon has effects on the spawning of slimes in swamp biomes, and contributes to the calculation of regional difficulty. The fuller the moon is, the greater the effect.

The moon does not actually have to be in the sky for this effect to take place, since the moon exists in daytime and across dimensions.

Regional difficulty


Regional difficulty or local difficulty is a value between 0.00 and 6.75 that the game calculates by considering not just the world difficulty setting, but also the inhabited time of a chunk, the total daytime in the world, and the phase of the moon. This value is shown on the debug screen as the first value listed after the heading "Local Difficulty". This value determines several aspects of the difficulty of gameplay (see below).

The inhabited time of a chunk increases for each tick a player spends with the chunk loaded. This is a cumulative measure of time—if 50 players spend a single hour in a chunk, it counts the same as if one player spent 50 hours there. The effect of inhabited time on regional difficulty is capped at 50 hours.

The total daytime in the world is the value from added to the "Day" on the F3 debug screen converted to ticks, i.e.  . This is not the same as the actual playtime in the world (the value from ). It affects the regional difficulty after the first 3 in-game days, and has no additional effect after 63 in-game days.

In pseudocode, the calculation of regional difficulty is:

if (difficulty is Peaceful) return 0 if (TotalDaytime > 63 in-game days) DaytimeFactor = 0.25 else if (TotalDaytime < 3 in-game days) DaytimeFactor = 0 else DaytimeFactor = (TotalDaytimeInTicks &minus; 72,000) / 5,760,000 if (ChunkInhabitedTime > 50 hours) ChunkFactor = 1 else ChunkFactor = ChunkInhabitedTimeInTicks / 3,600,000 if (difficulty is Normal or Easy) multiply ChunkFactor by 0.75 if (MoonPhase ÷ 4 > DaytimeFactor) add DaytimeFactor to ChunkFactor else add (MoonPhase ÷ 4) to ChunkFactor if (difficulty is Easy) multiply ChunkFactor by 0.5 RegionalDifficulty = 0.75 + DaytimeFactor + ChunkFactor if (difficulty is Normal) multiply RegionalDifficulty by 2 if (difficulty is Hard) multiply RegionalDifficulty by 3 return RegionalDifficulty
 * 1) DaytimeFactor, ChunkFactor, and RegionalDifficulty are floating-point variables
 * 2) MoonPhase is as in the table above.

The raw regional difficulty therefore is always 0.0 on Peaceful and ranges from 0.75 to 1.5 on Easy, 1.5 to 4.0 on Normal, and 2.25 to 6.75 on Hard.

Clamped regional difficulty
The clamped regional difficulty is a value between 0.00 and 1.00 based on regional difficulty. This value is shown on the debug screen as the second value listed after the heading "Local Difficulty". This is yet another value that affects the difficulty of gameplay (see below).

The regional difficulty value is clamped as follows:

if (RegionalDifficulty < 2.0) value = 0.0; else if (RegionalDifficulty > 4.0) value = 1.0; else value = (RegionalDifficulty &minus; 2.0) / 2.0;

Thus, on Easy, where regional difficulty is never higher than 1.5, the clamped value is always zero.

On Normal, the effects reach the maximum after 63 in-game day in a fully-inhabited chunk on a full moon; and on Hard after 63 in-game days the effects reach the maximum in chunks inhabited $$ hours during a full moon and remain at maximum in chunks inhabited over $$ hours.