mojira.dev
MC-88632

Unable to open command blocks & no particles when opening to LAN

Steps to reproduce

  1. Make a world with cheats enabled

  2. Open to LAN (Cheats disabled)

  3. Try using commands or using command blocks
    → Commands work, but command blocks have no placing animation and no breaking particles and you cannot interact with them (similar to MC-87872 and MC-87877)

Code analysis

The following is based on a custom decompiled version of Minecraft 1.10.2 using MCP 9.31.

This happens because the client thinks the player is unable to use commands and destroy command blocks whereas the server thinks the player is able to use commands and break command blocks because he is the owner.

  • Client method: net.minecraft.client.entity.EntityPlayerSP.canCommandSenderUseCommand(int, String)

  • Server method: net.minecraft.server.management.PlayerList.canSendCommands(GameProfile)

Related issues

MC-89128 Open to Lan Breaks Command Block GUI and more MC-89239 Cannot interact with Command Blocks in published single player MC-90621 Command blocks sometimes don't load their GUI for LAN guests, even after long periods of time MC-92467 Lan worlds giver either everyone admin permission, or gives no one permission. MC-96281 Command block, Open to Lan. MC-99407 Command Block Bug - LAN Multiplayer Issue - Command Blocks Are Not Editable - Sometimes Leads to Frozen Game On Quit MC-102716 Could not use command blocks when a LAN server was open. MC-103393 Command Blocks LAN w/o Cheats when having Cheats for yourself MC-105904 open to lan command block glitch MC-111195 Command block MC-113112 Can't use Command_Block MC-113390 I can't use command blocks. MC-116361 You can't interact with command blocks in multyplayer MC-121624 No break particles or place animation for command blocks on LAN MC-121625 Command block interface cannot be opened on LAN

Comments

migrated

Did you have cheats enabled?

[Mod] Neko

They are off but the player hosting can still run commands. Also theres no breaking animation.

kumasasa

You're seeing MC-87872 and MC-87877 , but are you sure that you're on 15w37a and not on 15w36 ?

[Mod] Neko

Yes 37a.

migrated

Can Confirm this is still a bug.

Had a LAN world for the past few weeks in the latest 1.8, swapped to Pre-3 and I am unable to use or edit command blocks.

migrated

A way you can work around this bug is to right-click a command block before you open the world to LAN. Then, you can edit the command block after you open it to LAN.

migrated

This is confirmed for 1.12.2

migrated

Ok I found and fixed the issue for my mod in 1.12:

In the IntegratedServer.shareToLan() you need to change:
        mc.player.setPermissionLevel(allowCheats ? 4 : 0);
to:
        mc.player.setPermissionLevel(allowCheats ? 4 : mc.player.getPermissionLevel());

 

yeah that's basically it that's all you have to do to fix said issue. It's already fixed in my 1.12.2 mod just need that little edit for 1.13

[Mod] Neko

Fixed recently it seems.

[Mod] Neko

(Unassigned)

Confirmed

command, command_block, lan, lan-world

Minecraft 15w37a, Minecraft 15w38a, Minecraft 15w38b, Minecraft 15w39a, Minecraft 15w39b, ..., Minecraft 17w47b, Minecraft 17w50a, Minecraft 18w05a, Minecraft 18w11a, Minecraft 18w22c

Minecraft 1.13-pre8

Retrieved