mojira.dev
MC-92759

Luck and Bad Luck don't work with double chests

The effects Luck and Bad Luck don't work when a double chest is opened, but the effects work when a simple chest is opened.

1: Place the file

[media]

in the folder:
.minecraft\saves\ MAP_NAME \data\loot_tables\test\chests\
2: Use the command:
/give @p minecraft:chest{BlockEntityTag:{LootTable:"test:chests/updated_table_loot"}} 1

3: Place and open the chest with effect Luck or Bad Luck.

4: Place and open an another chest (a double chest) with effect Luck or Bad Luck.

________________________________

:light_bulb_on: Look the screenshots in Attachment for the examples.

Sorry for my bad english.


Code analysis by @unknown can be found in this comment.

Linked issues

Attachments

Comments 12

Tan Chin Cheern

Attachment? Can you also post the table_loot.json folder here?

Oops, sorry.

EDIT : Attachments are added. 😉

Tan Chin Cheern

Confirmed.

Confirmed for 15w49b & 15w50a.

Confirmed for 15w51b.

2 more comments

Confirmed for 16w03a.

Confirmed for 16w04a.

Confirmed for 16w05a.

Confirmed for 1.9 pre-release 1.

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 that the method net.minecraft.tileentity.TileEntityChest.getStackInSlot(int) generates the loot when you try to open the chest. This method passes null as player opening the chest. Instead the loot should be created when the method net.minecraft.inventory.InventoryLargeChest.createContainer(InventoryPlayer, EntityPlayer) is called by calling the method net.minecraft.tileentity.TileEntityChest.createContainer(InventoryPlayer, EntityPlayer) for the upper and lower chest.

Fenrius

(Unassigned)

Confirmed

double-chest, loot-table, potion

Minecraft 15w44b, Minecraft 15w45a, Minecraft 15w46a, Minecraft 15w49b, Minecraft 15w50a, ..., Minecraft 16w05a, Minecraft 1.9 Pre-Release 1, Minecraft 1.10.2, Minecraft 1.11, Minecraft 1.13.1

Minecraft 19w02a

Retrieved