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 evokers, shulkers, hoglins, zoglins , piglins, piglin brutes , vindicators and the ender dragon. Even though evokers can spawn in peaceful, they do not summon vexes. Of these mobs, only the Ender Dragon can deal damage to the player. 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.

On Peaceful, there is only a 1 in a trillion chance that the portal is activated without any player intervention because The End cannot be accessed unless a seed with the End Portal already filled in is used, or by trading with villagers for eyes of ender in pre-1.9. Blaze rods are for the most part required to activate the End Portal, and eyes of ender have a 10% chance of already existing in each of the end portal frame blocks, and the only way to obtain blaze rods to make the eyes of ender is directly from a blaze. However, due to the huge number of possible seeds, over 8 million seeds $$ are known to generate portals filled with 12 eyes of ender. Also, not all 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 rarely 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 an infinite duration $$. Villagers killed by zombies always turn into zombie villagers. Pillagers spawn near the player, with their attacks dealing damage. $$, if the world type is infinite, they deal damage.

Hardcore mode
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, if the player dies, they can choose to respawn in Spectator mode or delete the world. In multiplayer, the player's gamemode is automatically set to Spectator mode upon their death.

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 $4 1/6$ hours during a full moon and remain at maximum in chunks inhabited over $16 2/3$ hours.