Spectator mode uses survival block and entity reach distance instead of creative
The bug
In spectator mode you have the same block and entity reach distance as in survival or adventure mode when you try to open containers.
I would expect it to use the reach distance of creative mode as a higher reach distance gives no gameplay advantage in spectator mode but makes interaction a little bit easier.
How to reproduce
- Change your gamemode to creative
- Stand in the middle of a block
- Use the following command or just place a chest in +x direction manually
/setblock ~1 ~ ~ chest
- Use the following command
/tp ~-4.4 ~ ~
- Try to open the chest; it should work
- Switch to spectator mode and try to open the chest again
→
You are unable to open the chest
The reason
The following is based on a decompiled version of Minecraft 1.10 using MCP 9.30.
The method net.minecraft.client.multiplayer.PlayerControllerMP.getBlockReachDistance() returns only 4.5 if the player is in creative mode otherwise it returns 4. Additionally the method net.minecraft.client.multiplayer.PlayerControllerMP.extendedReach() is called to test if the player is in creative mode and in that case sets the entity reach distance to 6 (might not be the case anymore in 1.11+).
2016-10-15, 06:10 PM
2024-06-21, 03:51 PM
11
6
block, container, creative, entity, reach
Minecraft 1.10.2 - 1.21
Minecraft 1.10.2, Minecraft 16w41a, Minecraft 1.11, Minecraft 1.12.1, Minecraft 1.12.2, Minecraft 17w43a, Minecraft 17w43b, Minecraft 18w06a, Minecraft 1.13.1, 1.15.1, 1.15.2 Pre-release 2, 1.15.2, 1.16.3, 1.16.4 Pre-release 1, 20w46a, 21w03a, 21w05b, 21w06a, 1.20.2, 1.20.3 Pre-Release 2, 24w05b, 1.21
-