mojira.dev
MC-65198

"minecraft.crafted:minecraft.<ITEM>" doesn't increase correctly when crafting items with shift-click or drop actions

The Bug:

"minecraft.crafted:minecraft.<ITEM>" doesn't increase correctly when crafting items with shift-click or drop actions.

Steps to Reproduce:

Drop action:

  1. Create a scoreboard objective for tracking when you craft some stone bricks and set it to display on the sidebar by using the commands provided below.

    /scoreboard objectives add CraftStoneBricks minecraft.crafted:minecraft.stone_bricks
    /scoreboard objectives setdisplay sidebar CraftStoneBricks
  2. Obtain a stack of stone and place down a crafting table.

  3. Open the crafting table and craft four stone bricks by left-clicking the output slot in the crafting table.

  4. Take note of how the scoreboard correctly increases by a value of "4" as you have crafted four stone bricks.

  5. Craft four stone bricks once again, but this time use the drop action function to craft the items by pressing your drop key whilst holding your mouse cursor over the output slot in the crafting table.

  6. Take note of how the scoreboard only increases by a value of "1" despite crafting four stone bricks.

Shift-click:

  1. Create a scoreboard objective for tracking when you craft some stone bricks and set it to display on the sidebar by using the commands provided below.

    /scoreboard objectives add CraftStoneBricks minecraft.crafted:minecraft.stone_bricks
    /scoreboard objectives setdisplay sidebar CraftStoneBricks
  2. Obtain a stack of stone and place down a stonecutter.

  3. Open the stonecutter and craft a singular stone brick block by left-clicking the output slot in the stonecutter.

  4. Take note of how the scoreboard correctly increases by a value of "1" as you have crafted one stone brick block.

  5. Craft a stone brick block once again, but this time hold your mouse cursor over the output slot in the stonecutter and shift-click.

  6. Take note of how the scoreboard doesn't increase despite crafting a stone brick block.

Observed Behavior:

"minecraft.crafted:minecraft.<ITEM>" doesn't increase accordingly.

Expected Behavior:

"minecraft.crafted:minecraft.<ITEM>" would increase accordingly.

Related issues

Attachments

Comments

migrated
[media][media][media][media][media]
marcono1234

Relates to:

migrated

I can't confirm it for example in 1.12 pre-release 5 because objective's criteria stat.craftItem.minecraft.planks has been remove of game 😞

But confirm for 1.12 pre-5 with an other example: craftItem.minecraft.redstone

violine1101

You can still check the statistics page, can't you? Also, it's stat.craftIetm.minecraft.planks, not stat.craftIetm.minecraft:planks

migrated

It's edit thx 🙂
Always this problem so.

migrated

Confirmed for 1.13.1.

bluecrab2

Confirmed in 20w15a

bluecrab2

Confirmed in 20w28a

pulpetti

Confirmed in 1.16.1

migrated

Same problem with smithing tables

marcono1234

@@unknown, could you please clarify what you mean by that? All vanilla smithing table recipes only yield 1 result item and for me it correctly updates the statistics when left clicking, right clicking and using the drop item key.
Please also make sure that you are not experiencing MC-202166.

bluecrab2

Confirmed in 20w48a

Johnibur

I have updated the ticket including reproduction steps with the scoreboard system and one UI where this issue happens: the stonecutter.

CreeperMagnet_

Affects 21w18a.

Avoma

Can confirm in 1.17.1.

Avoma

I'd like to request ownership of this ticket since the current reporter has been inactive for over a year. I'm willing to keep this ticket updated and will continue to provide all of the necessary details.

migrated

I agree. Thanks. 

migrated

Affects 1.19

migrated

Affects 1.19.4 pre-release 4.

migrated

This can be traced back in ResultSlot class, as under the "remove" method, the parameter p_40173_ is taking both primary and secondary (splitting) values. As seen in line 414 & 415 in AbstractContainerMenu class. 

[media]

 

This is important because the remove method sets the removeCount as the j3 value (and since right click splits the amount, it's halved). The removeCount is later used to trigger the scoreboard achievement , so the scoreboard achievement is not accurate to what's crafted.

 

(removeCount being set as the min value - which is the split value)

[media]

 

(line 43 triggers the scoreboard increment)

[media]

 

 

 

I'm pretty sure this is what is happening to the drop action as well because it thinks you're only removing out 1 item count from the slot.

Avoma

(Unassigned)

Confirmed

Platform

Normal

Statistics

Minecraft 14w31a, Minecraft 14w32a, Minecraft 14w32b, Minecraft 14w32c, Minecraft 14w32d, ..., 1.21.2 Pre-Release 3, 1.21.3, 1.21.4, 25w08a, 1.21.5

Retrieved