mojira.dev
MC-44471

Difficulty lock appears to be unlocked if switching dimensions

The bug

If you lock your difficulty in then go into a different dimension the lock is undone. If you lock it in that dimension and go back to the original one. It will be undone again.

Code analysis

Code analysis by @unknown can be found in this comment.

Related issues

MC-47686 difficulty lock associated with a world MC-47759 Difficulty-Lock Unlocks MC-52445 Entering The End Unlocks the Difficulty MC-55324 Lock button becomes unlocked MC-59722 Death in the Nether MC-63267 Switch between worlds (overworld/nether) unlock difficulty. MC-65319 Difficulty Lock MC-71383 in single player the difficulty is unlocked when you change dimensions after you lock it in the previous dimension MC-77385 Difficulty unlocks upon going into Nether/End MC-79551 Minecraft 1.8.3 Difficulty glitch MC-81112 Changing dimension unlocks world difficulty MC-81861 Difficulty unlocks and sets itself to Easy every time I enter the Nether MC-86626 if you lock difficulty, then go to the end, and back, the difficulty is unlocked MC-92948 Difficulty unlocks when entering a portal. MC-98025 Locking Difficulty MC-105022 Changing Language Unlocks World Difficulty Visually MC-112352 Changing dimension reset the lock difficulty button MC-114058 Traveling to Nether via portal "unlocks" world difficulty MC-119222 Difficulty keeps unlocking

Comments

migrated

Also, only the button is reset; the difficulty is still locked.

Ezekiel

Does switching dimensions, logging out of the world, then logging back in fix the visual issue?

migrated

Oh yes it is just a visual glitch. Thank you for helping!

migrated

Still an issue in 08a and 10c.

migrated

Still in 14w11b

migrated

Confirmed for 14w17a

MagboneD

I can confirm this is present in 1.8.1. It appears to be a gui-related issue. You can cycle the button to peaceful, but hostile mobs will not despawn.

migrated

I'm having the same issue in 1.8.7. The difficulty is unlocked and reverted to Easy upon moving between dimensions.

Ubuntu 14.04 64-bit system with Intel HD integrated graphics card using Oracle 8 Java Runtime Environment

marcono1234

Please link to this comment in the description

The following is based on a decompiled version of Minecraft 1.9 using MCP 9.24 beta.

The reason for this is the same as for MC-679. When the player enters a different dimension a new WorldClient object is created an most of the data is copied from the previous WorldClient object. Whether or not the difficulty is locked is only send when the player joins a server (or loads a world). When he changes the dimension the method net.minecraft.client.network.NetHandlerPlayClient.handleRespawn(SPacketRespawn) does not set whether or not the difficulty is locked for the new WorldClient.

migrated

Is it a visual glitch tho? I've been able to cycle my difficulty (Locked at hard from world gen) and it still gives the whole blurb about locking the difficulty when I click the button.

I haven't actually played on any other difficulty to see if there was a difference and I haven't cycled to peaceful (In fear some of my named hostile mobs would despawn)

Also, confirmed 1.9.4

migrated

Confirmed for 1.13.1.

migrated

update 1.12.2 still

migrated

boq

Confirmed

difficulty, end, lock, nether, overworld, unlock, visual

Minecraft 14w02a, Minecraft 14w02b, Minecraft 14w02c, Minecraft 14w03b, Minecraft 14w04a, ..., Minecraft 1.13.1-pre1, Minecraft 1.13.1, Minecraft 18w48a, Minecraft 18w48b, Minecraft 18w49a

Minecraft 19w11a

Retrieved