While running (/loot) command, the loot items are replaced in different slots (slot.weapon.mainhand ; slot.weapon.offhand, etc.) Even when running to set loot in an specific slot.
Eg: While using the /loot replace entity @s βslot.weapon.mainhandβ 0 loot "chests/ancient_city" ,
The loot replaces in Helmet Slot, Offhand, Leggings slot.
The command:
/Loot replace entity @e/a/s/p (any slot) (slot number) loot/kill (entity/chest ; structure/entity)
Attachments
Comments 3

Can confirm, affects 1.20.80.24.
Steps to reproduce:
Enter a world with cheats enabled.
Type the following command:
/loot replace entity @s slot.weapon.mainhand 0 loot "chests/ancient_city"
Open your inventory to observe which slots the items have been placed.
Observed results:
Loot is given, but it gets displaced and is put in both your offhand and head slots, alongside your mainhand.
Expected results:
Items should only be placed in your mainhand slot.
Notes:
This also appears to affect slot.weapon.offhand
.
Thank you for your report!
However, this issue is Working as Intended.
Please note, that mechanics of the game may change between updates.
Things such as graphics, sounds, world creation, biomes, redstone, villagers, and animals may not work the same in current versions.
Full Version History -- Snapshot Version History -- Feature Requests and Suggestions
Quick Links:
π Bug Tracker Guidelines -- π¬ Community Support -- π§ Mojang Support (Technical Issues) -- π§ Microsoft Support (Account Issues) -- π Project Summary -- βοΈ Feedback and Suggestions -- π Game Wiki