Affects Version/s: Minecraft 1.12.1, Minecraft 1.12.2, Minecraft 18w20c, Minecraft 18w21a, Minecraft 18w21b, Minecraft 1.13-pre1, Minecraft 1.13-pre2, Minecraft 1.13-pre3, Minecraft 1.13-pre4, Minecraft 1.13-pre5, Minecraft 1.13-pre8, Minecraft 1.13, Minecraft 1.14.2, 1.15.2
Fix Version/s: None
Given the following advancement (world/data/advancements/skylinerw/context.json):
And the following loot table (world/data/loot_tables/skylinerw/context_loot.json), where you receive 1 stone for having a Luck value of 1+, 2 dirt if you have Looting 1 (or 1 dirt if you do not), and 1 sand at all times:
Holding a Looting sword that also increases luck, and then rewarding yourself with the advancement, will not grant you the expected items:
*Expected items:* 1 stone, 2 dirt, 1 sand.
*Actual result:* 1 dirt, 1 sand.
Versus killing a mob using that loot table with the sword, which will provide you with the expected items:
Using MCP for 1.12: in method net.minecraft.advancements.AdvancementRewards.func_192113_a(), the LootContext builder receives only the player themselves through the withLootedEntity() method (normally this would be the entity that was killed). The methods withDamageSource() (for the "looting_enchant" function) and withLuck() methods would need to be appended for the above table to work as expected. It could also append withPlayer(), though this would be irrelevant since all the loot table features covered by this is already accessible thanks to withLootedEntity(), and everything else (such as the "killer_by_player" condition) is redundant.