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
relates to 2
Attachments
Comments 12
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.
Attachment? Can you also post the table_loot.json folder here?