I was messing around with a stat.drop scoreboard and I noticed that the stat wont increase when a Player is in an Inventory screen an throws some Items either with drag'n'drop or by hovering over an Item and pressing Q (drop).
Also, it wont give a player 20 points when he drops 20 Items at once via ctrl+Q (drop)
Fix appreciated 🙂
~ Halbzwilling
Code analysis by @unknown can be found in this comment.
Related issues
is duplicated by
Comments

Can confirm for 14w32
Confirmed for 1.8
Can confirm for 1.8.5 on Mac OS 10.8.5
Confirmed for 15w47c

Confirmed for
16w05b
Please link to this comment in the description
The following is based on a decompiled version of Minecraft 1.8 using MCP. All method and class names are the ones used in the decompiled version.
The reason why this happens is because different methods are called depending on whether the player has his inventory or any GUI open or not.
When the player throws an item while having a GUI open, the public EntityItem dropPlayerItemWithRandomChoice(ItemStack itemStackIn, boolean p_71019_2_)
method of the net.minecraft.entity.player.EntityPlayer
class is called.
This method should probably look like this:
/**
* Args: itemstack, flag
*/
public EntityItem dropPlayerItemWithRandomChoice(ItemStack itemStackIn, boolean p_71019_2_)
{
// Changed this
//return this.func_146097_a(itemStackIn, false, false);
return this.func_146097_a(itemStackIn, false, p_71019_2_);
}
The reason for this is that the argument p_146097_3_
of the method public EntityItem func_146097_a(ItemStack p_146097_1_, boolean p_146097_2_, boolean p_146097_3_)
indicates whether or not the item was thrown by the player or got created in any other way.
So in theory this should also fix a bug where the achievement "Diamonds to you!" does not work if the player throws the diamond while having a GUI open.
Confirmed for 1.9.4
Confirmed for 16w20a
Confirmed for 1.10-pre1

Fixed for 16w42a
Confirmed for
14w30c
14w31a
Minecraft 1.8-pre 2
1.8.3 because of MC-79097
Also relates to:
MC-65198