mojira.dev
MC-147729

Crafting via the recipe book can delete items if picking up items while crafting

The bug

If you pick up items while crafting, and then try to use these items in the crafting recipe, those items will disappear.

To reproduce

  1. Place a crafting table

  2. Fill your inventory with a random item that you won't use (for example, cobblestone), and leave seven slots free.

  3. Fill these seven slots with seven stacks of iron ingots

  4. Throw two stacks of iron ingots on the ground near the crafting table

  5. Switch into survival mode

  6. Shift-click onto the iron block recipe in the recipe book while interacting with the crafting table

  7. The crafting table now is ready to craft 49 iron ingots

  8. You pick up the remaining two stacks of iron ingots, and an additional 7 iron ingots were left in your inventory

  9. Shift-click onto the iron block recipe again
    → ❌ The two stacks of iron ingots will disappear and the crafting table now shows a non-functioning recipe

Videos

  • Longer explanation by @unknown: video

  • How to reproduce by @unknown:

[media]

Linked issues

MC-136361 Items disappear when using recipe to craft with items on ground Resolved MC-154078 Items get deleted when the player's inventory is refilled while using the recipe book. Resolved MC-154904 Recipe book crafting possibly loses items when picking up items during crafting Resolved MC-158347 Items can get lost when using the Knowledge book Resolved MC-159662 Items disappear after using the recipe book (not crafting) and exiting the inventory Resolved

Attachments

Comments 11

Confirmed. I've rewritten this ticket to include steps to reproduce, and attached a shorter video of me reproducing this bug.

This issue also affects 1.14.3pre2. I've attached the images from my duplicate issue (MC-154078) as I think it's the simplest way to reproduce this bug.

Affects 1.14.3pre3

To clarify on reproducing this bug:

  • The player's inventory must be full.

  • Shift-clicking a recipe must make some amount of empty space in the inventory.

  • The player must then pick up items which fill that empty space.

  • Those items that are picked up into the empty space will be deleted if the player shift-clicks the recipe again, but the recipe book will spread out the items on the crafting interface as if they all still existed.

I cannot find a way to reproduce this without creating an empty space in the inventory. If shift-clicking the recipe does not create an empty space, the items on the ground will simply top up any stacks you have, which then seems to correctly(?) prevent shift-clicking the recipe more. Also, the type of item used doesn't seem to matter.

Still in 1.14.4.
On a server the console also gets spammed with "ERROR Can't find any space for item in the inventory"

This issue is still present in 1.15-pre1.

What is even more surprising that it is still UNASSIGNED!

IMHO, item deletion is a serious bug and should be prioritized.

 

1 more comments

Fix for this issue here: https://github.com/PaperMC/Paper/commit/01b1971a43f56da6418f3f623dc972f46dcff373

 

 

int j = this.c.firstPartial(itemstack);

if (j == -1) {
    j = this.c.getFirstEmptySlotIndex();
}
// Paper start
if (j == -1) {
    this.c.player.drop(itemstack.cloneItemStack(), false);
    break;
}
// Paper end
ItemStack itemstack1 = itemstack.cloneItemStack();

itemstack1.setCount(1);
if (!this.c.c(j, itemstack1)) {
    AutoRecipe.LOGGER.error("Can't find any space for item in the inventory");
}

Affects 1.16.4 Release Candidate 1

Isn't iron blocks instead of iron ingots in "The crafting table now is ready to craft 49 iron INGOTS"

It is still a little buggy because the iron ingots that will be in the inventory won't teleport to the crafting grid

Fefo6644

eowyn36

Confirmed

Important

Crafting, Inventory, Items, UI

Minecraft 1.13.2, Minecraft 19w12b, Minecraft 19w13b, Minecraft 19w14a, Minecraft 19w14b, ..., 20w15a, 1.16.1, 1.16.2 Pre-release 3, 1.16.2, 1.16.4

20w46a

Retrieved