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.

Linked issues

MC-47686 difficulty lock associated with a world Resolved MC-47759 Difficulty-Lock Unlocks Resolved MC-52445 Entering The End Unlocks the Difficulty Resolved MC-55324 Lock button becomes unlocked Resolved MC-59722 Death in the Nether Resolved

Comments 12

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

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

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

Still an issue in 08a and 10c.

Preben Gjelsvik

Still in 14w11b

2 more comments

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

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.

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

Confirmed for 1.13.1.

update 1.12.2 still

Mark Davidson

Kraif

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