When crafting something that gives more than one item as an result (e.g. diamond blocks to diamonds, stairs, slabs) and not all resulting items fit into the inventory, the overflow gets deleted.
Steps to reproduce
1. Prepare your inventory like this (Put the diamond blocks into the free spot, instead of the crafting field)
2. Make sure you are in survival (/gamemode 0)
3. Craft the 8 diamond blocks into diamonds.
4. The expected result would be 72 diamonds (8*9), but you only get 64
Ways to fix
I mainly see two ways to fix this.
1. Check if there is enough space in the inventory before hand (This is probably a bit more work to implement as there is no such method, I think)
2. Drop the overflowing items.
While I personally prefer the first one, the second one should be easy to implement.
It is a one liner, but due to old copy paste code it would need to be change in several different spots (Villager, Player, Workbench, maybe also Furnace and Anvil).
So for a nice fix some more generic Inventory/Container code would be good.
Code analysis: https://bugs.mojang.com/browse/MC-1555?focusedCommentId=288028&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-288028
Fix note: https://twitter.com/_LadyAgnes/status/762734666042441730
Related issues
is duplicated by
relates to
Attachments
Comments


Confirmed. Nasty bug.
Edit: Can I suggest changing title of bug to something like "Splitting blocks into separate items not properly checking for full inventory"

Affects 1.6.4 and snapshot 13w38c.

Still a bug in 1.7.2.

I can verify that this bug still exists in 1.7.2.

This is true for all recipes that create more than one item per one input. Can confirm for 14w08a (latest snapshot as of now). It's a nasty bug and someone should fix it.

Still exists in 1.7.5. Not really surprising as Amunak confirmed it for the current Snapshots.

Confirmed for snapshot 14w18b.

This is a seriously bad bug. I am surprised to see it still in the game after all this time.
Edit: You may also want to add that this affects Windows users as well, not just Linux.

Confirmed for the latest snapshot 14w26a/b/c
Happens on windows too.
happened with crafting torches
I had 63 and I expected to drop the 3 other torches I crafted... but it didn't.
Btw vote for this bug If you want it fixed and keep updating the Affects Versions.
and maybe even bother the mojangsters by tweeting them the major bugs 😉
and add some more labels so people can find it easier

Confirmed for 14w27a.
C'mon mojang, this would take like 5 minutes to fix, and it's been around for almost 2 years.

And it's still in 14w28a...

Confirmed for 14w28a

Confirmed for 14w32a,
I'd suggest changing Environment to All OS, although I can only confirm this on Windows 7 64 bit with Java 8u11.
I'd also suggest adding the labels "item" "items" "inventory" "item deletion" "block" and "full".

Confirmed for 14w33a.

Affects version 14w34a.

and 14w34b

still in 14w34c and d ... I guess we'll have this bug in 1.8

Confirmed for 1.8-pre1.

and 1.8-pre2 & 3

Confirmed for 1.8 official release

Confirmed for 1.8.1-pre2

I attached proper screenshots of the issue (my skin is blacked out because it's terrible). First two are the buggy behavior when shift clicking, second two are the what happens under normal circumstances.
It's worth noting that this bug affects ALL mineral blocks.
I can provide more screenshots or even video if it is necessary.

It's basically just destroying the remainder of 1 block. It's not completely destroying all blocks. Although this is still obviously an issue, it's not as bad as it would seem, but still of course bad! 😃 Essentially it sees that there is one slot open, so it fills it with the first 7 blocks to 63. Then it sees that it can fill one more item, it does so, but doesn't know what to do with the remainder, so apparently it just destroys it. If you have 8 blocks exactly then you wind up with no blocks left. If you have more than 8 blocks, then you wind up with how ever many blocks you had minus 8. This same effect happens where the last block loses its remainder all the way up to 8 free inventory slots. The good news is is that for each additional empty slot, you have less of a remainder that you're losing 😃

Since this bug affects all recipes that give multiple items, the title should be changed to something like "Recipes that give multiple items not properly checking for full inventory".
Confirmed in 1.8.1-pre5

Confirmed in 1.8.2-pre1. Also affects wood planks. Can occur even when crafting more than a full stack (e.g. 22 diamond blocks + 3 empty slots -> 192 diamonds instead of 198).

Confirmed in 1.8.2-pre2, -pre3, and -pre4

Confirmed in 1.8.7.

Confirmed in 1.8.8 and 15w31a
Edit: and 15w31b
Edit2: and 15w31c

Another week, another version it's in. 15w32a.
Edit: and 15w32b
Edit2: and 15w32c

It's in 15w33c

Still in 15w38a, Can a mod label this Bug as "item deletion" or for the sake of it as "item duplication"?
I know it's not a duplication issue but item dupes are fixed fast. Loss of items due to a bug seems to be okay for years now...
Can confirm for 15w38b, also I agree with @unknown that the title could be a bit more clear about the deletion of items 🙂

The title should also say that this happens for any recipe, not just for splitting blocks into separate items (well, I assume it does, I didn't actually test it).

I don't know if this is part of this bug but if you Shift left click an item that is already in a full chest it just deletes it, which ties into the game not registering that your inventory is full.

Couldn't find it with search as was looking for "shift". Reported it again [MC-88994].
I didn't have this happening to me in released versions though, snapshot 15w38b is the first one I saw this in.

@Maria, this issue and MC-88994 are different problems, which is why yourself (and several others) have experienced it only in the snapshot.

Changed reporter to @unknown

Still in 15w42a

Still happening in 15w45a. Did the same thing as in the images, 8 diamond blocks and the extra diamonds got erased.

Confirmed for 15w46a

Still happening in 15w47a.

Confirmed for 15w51b.

Confirmed for 16w02a.

Confirmed for 16w03a.

Unless providing additional information about the issue, please keep discussions on the Jira Subreddit.

@[Mod] CubeTheThird: Thanks, I'll keep it there in the future.

Affects 16w04a.

Still in 16w05b

Affects 16w06a.

Affects 16w07a.

Affects 16w07b.

Confirmed for 1.9-pre1

Affects 1.9-pre2

Please link to this comment in the description of the report.
The following is based on decompiled version of Minecraft 1.8 using MCP. All method and class names are the names used in the decompiled version.
The reason why this happens is that the protected boolean mergeItemStack(ItemStack stack, int startIndex, int endIndex, boolean useEndIndex)
method of the net.minecraft.inventory.Container
class assumes it can always take only a part of the stack. This works for containers but not for crafting GUIs where it is either all or nothing (in this case it thinks it should remove all). This could be fixed by using a parameter to indicate whether the item stack can be splitted or not.
The following shows one possible way to fix this.
Class: net.minecraft.inventory.Container
// This is the method with the parametes normally used
protected boolean mergeItemStack(ItemStack stack, int startIndex, int endIndex, boolean useEndIndex) {
return mergeItemStack(stack, startIndex, endIndex, useEndIndex, true);
}
/**
* Merges provided ItemStack with the first avaliable one in the container/player inventor between minIndex
* (included) and maxIndex (excluded). Args : stack, minIndex, maxIndex, negativDirection. /!\ the Container
* implementation do not check if the item is valid for the slot
*/
// Added the parameter "canStackBeSplitted" (boolean)
// protected boolean mergeItemStack(ItemStack stack, int startIndex, int endIndex, boolean useEndIndex)
protected boolean mergeItemStack(ItemStack stack, int startIndex, int endIndex, boolean useEndIndex, boolean canStackBeSplitted)
{
boolean var5 = false;
int var6 = startIndex;
if (useEndIndex)
{
var6 = endIndex - 1;
}
Slot var7;
ItemStack var8;
if (stack.isStackable())
{
while (stack.stackSize > 0 && (!useEndIndex && var6 < endIndex || useEndIndex && var6 >= startIndex))
{
var7 = (Slot)this.inventorySlots.get(var6);
var8 = var7.getStack();
if (var8 != null && var8.getItem() == stack.getItem() && (!stack.getHasSubtypes() || stack.getMetadata() == var8.getMetadata()) && ItemStack.areItemStackTagsEqual(stack, var8))
{
int var9 = var8.stackSize + stack.stackSize;
if (var9 <= stack.getMaxStackSize())
{
stack.stackSize = 0;
var8.stackSize = var9;
var7.onSlotChanged();
var5 = true;
}
// Replaced this to test if the stack can be splitted
//else if (var8.stackSize < stack.getMaxStackSize())
else if (canStackBeSplitted && var8.stackSize < var8.getMaxStackSize())
{
stack.stackSize -= stack.getMaxStackSize() - var8.stackSize;
var8.stackSize = stack.getMaxStackSize();
var7.onSlotChanged();
var5 = true;
}
}
if (useEndIndex)
{
--var6;
}
else
{
++var6;
}
}
}
//...
return var5;
}
Class: net.minecraft.inventory.ContainerWorkbench
/**
* Take a stack from the specified inventory slot.
*/
public ItemStack transferStackInSlot(EntityPlayer playerIn, int index)
{
ItemStack var3 = null;
Slot var4 = (Slot)this.inventorySlots.get(index);
if (var4 != null && var4.getHasStack())
{
ItemStack var5 = var4.getStack();
var3 = var5.copy();
if (index == 0)
{
// Index 0 is the crafting result which cannot be splitted
//if (!this.mergeItemStack(var5, 10, 46, true))
if (!this.mergeItemStack(var5, 10, 46, true, false))
{
return null;
}
var4.onSlotChange(var5, var3);
}
//...
}
return var3;
}
Class: net.minecraft.inventory.ContainerPlayer
/**
* Take a stack from the specified inventory slot.
*/
public ItemStack transferStackInSlot(EntityPlayer playerIn, int index)
{
ItemStack var3 = null;
Slot var4 = (Slot)this.inventorySlots.get(index);
if (var4 != null && var4.getHasStack())
{
ItemStack var5 = var4.getStack();
var3 = var5.copy();
if (index == 0)
{
// Index 0 is the crafting result which cannot be splitted
//if (!this.mergeItemStack(var5, 9, 45, true))
if (!this.mergeItemStack(var5, 9, 45, true, false))
{
return null;
}
var4.onSlotChange(var5, var3);
}
//...
}
return var3;
}
Class: net.minecraft.inventory.ContainerMerchant
/**
* Take a stack from the specified inventory slot.
*/
public ItemStack transferStackInSlot(EntityPlayer playerIn, int index)
{
ItemStack var3 = null;
Slot var4 = (Slot)this.inventorySlots.get(index);
if (var4 != null && var4.getHasStack())
{
ItemStack var5 = var4.getStack();
var3 = var5.copy();
if (index == 2)
{
// Index 2 is the item the player receives
//if (!this.mergeItemStack(var5, 3, 39, true))
if (!this.mergeItemStack(var5, 3, 39, true, false))
{
return null;
}
var4.onSlotChange(var5, var3);
}
//...
}
return var3;
}
Note: There might be other GUIs affected as well but I currently cannot think of any other ones

Affects 1.9-pre4.

Confirmed for 1.9.1-pre3.

Affects 1.9.1 (and probably 1.9.2, as it will only be a fix for MC-100283)

Confirmed for 1.RV PreRelease 1 (I know its an April Fools joke but it still affects it)

@unknown: 1.RV-pre1 is not tracked here.

@unknown you can also just say "confirmed for 1.9.2".

Confirmed for 1.9.3-pre3.

Confirmed for 1.9.4.

Confirmed for 16w20a.

I don't see someone suggesting an intended behaviour yet in these comments. Should it...
...drop the remaining items (in the example dropping 8 diamonds)
...don't execute the crafting that overflows the inventory (in the example only craft 7 blocks to diamonds, leaving 1 in the crafting area)
...give you the remaining items to your cursor (in the example the 8 diamonds, don't really see why it should)

I'd say the second option, that seems the most logical.

The third option wouldn't work, you can shift-craft while holding items with your cursor.

Confirmed for 16w21a.

Confirmed for 16w21b.

Confirmed for 1.10-pre1.

Confirmed for 1.10-pre2.

Confirmed for 1.10.

Confirmed for 1.10.1.

Confirmed fixed for 16w32a