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)

Linked issues

MC-89128 Open to Lan Breaks Command Block GUI and more Resolved MC-89239 Cannot interact with Command Blocks in published single player Resolved MC-90621 Command blocks sometimes don't load their GUI for LAN guests, even after long periods of time Resolved MC-92467 Lan worlds giver either everyone admin permission, or gives no one permission. Resolved MC-96281 Command block, Open to Lan. Resolved

Comments 9

Dlawso the Really Lucky Rabbit

Did you have cheats enabled?

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

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

Yes 37a.

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.

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.

This is confirmed for 1.12.2

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

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