mojira.dev
MC-273077

/loot command returns a wrong message

Steps to reproduce:

  1. Summon a witch and execute this command:

    /execute as @p run loot give @s kill @e[type=witch,limit=1]

Observed result:
The message said only 4 items.

Expected result:
The message says 14 items.

The first command block is used to clear all items except the sword, and the second executes loot command.

Attachments

Comments 6

Actually, I don't think the custom loot table is the cause. After some testing, I've realised that it appears to be referring to the number of types of items dropped, not the actual number of items. I've tested this with other mobs and it seems that if only one type of item is dropped, it states the number of that item dropped, and if it is more than one item, it states the number of types of items dropped. This is the case in the screenshot you have shared therefore I do not think that this is a bug, although the output text could perhaps use some clarity e.g. "Dropped 2 item types...".

If this bug requires a custom loot table to reproduce, please attach a datapack .zip file that can be used to help reproduce this issue

No datapacks needed. I have investigated the source code, everything @FelixR said is right, mojang returned the number of stacks of items, not the total items.

How can you prove that it was meant to be 14 items instead of 4? Once I understand that I can look at confirming this as a bug

See the hotbar in my screenshot, the first command block cleared all items except the sword before executing /loot so you add other items up, there are 14 items in total.

zly2006

(Unassigned)

Confirmed

Platform

Low

Commands

1.20.6, 1.21 Pre-Release 4, 1.21

Retrieved