The bug
When a player in spectator mode right clicks a container entity (currently only MinecartChest and HopperMinecart) the "Unable to open. Loot not generated yet." message is printed twice.
Note: This message has also one space too much at the end.
How to reproduce with MCP (1.11+) (easy)
Locate
net.minecraft.entity.player.EntityPlayerMP.displayGUIChest(IInventory chestInventory)
.Change the
true
in the following line tofalse
.this.addChatComponentMessage((new TextComponentTranslation("container.spectatorCantOpen", new Object[0])).setStyle((new Style()).setColor(TextFormatting.RED)), true);
Start Minecraft
Summon for example a MinecartChest
/summon chest_minecart ~ ~ ~ {LootTable:"chests/simple_dungeon"}
Switch to Spectator mode
Right-click the MinecartChest
How to reproduce (1.11+) (advanced)
Note: The following steps will cause the original version folder to be deteled
Open the {{%appdata%\.minecraft\versions}} directory
Copy the folder of the latest version and rename the copied folder to "MC-94682"
Open the copied folder and apply @unknown's modification (requires Python)
Rename the
.jar
file to "MC-94682"Open the
.json
file in the copied folder with a text editorSet "MC-94682" as
id
Remove the contents of the
downloads
key at the end of the the file
Start Minecraft
Select the version called "MC-94682"
Summon for example a MinecartChest
/summon chest_minecart ~ ~ ~ {LootTable:"chests/simple_dungeon"}
Switch to Spectator mode
Right-click the MinecartChest
Delete the folder of the version you modified again and rename the copy to the original name
The reason
The following is based on a decompiled version of Minecraft 1.9 using MCP 9.24 beta.
The reason why this happens is because the method net.minecraft.client.multiplayer.PlayerControllerMP.func_187097_a(EntityPlayer, Entity, ItemStack, EnumHand)
returns EnumActionResult.PASS
for players in spectator mode. Because of this the player right clicks with his main- and offhand on the entity. This could be solved by having the method net.minecraft.client.Minecraft.rightClickMouse()
in general run only for the mainhand if the player is in spectator mode.
Linked issues
is duplicated by 2
relates to 1
Comments 9
You don't need MCP to check this. Just manipulate the bytecode using this python script that uses jawa. Should be easy enough to confirm in any version with it.
Thank you very much! How do you prevent the launcher from replacing the modified jar file when starting the game?
Confirmed for 15w51b.