mojira.dev
MC-272643

Items containing using_converts_to cannot be stacked with the original items after restarting the world.

Items containing the using_converts_to item component cannot stack with the original items after restarting the world.

 

How to reproduce:

1.Use this command:

/give @p honey_block[minecraft:food={can_always_eat:true,eat_seconds:0.05,nutrition:1,saturation:0,using_converts_to:{id:"moss_block"}}] 64

2.Place items individually in inventory

3.reopen the world

4.Try to stack with the original item

 

I mentioned this bug in MC-271929 and since it hasn't been fixed yet, I created this report

MC-271929 video

 

Sorry, because during the editing process, Google's webpage translation translated the text I edited, so I edited it several times to change it back to English.

Linked issues

Attachments

Comments 4

Can confirm in 1.21pre2. Also, when in creative mode, the items won't be able to stack immediately after unstacking. If you unstack the items in creative mode, then go into survival mode, the items that were unstacked in creative mode cannot be stacked in survival mode either.

Some code insight:
It happened because `ItemStack` does not support `equals`, messing up `Optional<ItemStack>::equals` and therefore stacks with the same food data with container will not stack.

One solution is to override `FoodProperties::equals`. Another is to implement `ItemStack::equals`

24w33a This bug is more serious than ever:

 

[media]

Bee

kingbdogz

Community Consensus

Platform

Normal

Commands

1.21 Pre-Release 1, 1.21 Pre-Release 2, 1.21 Pre-Release 3, 1.21, 1.21 Release Candidate 1, 1.21.1, 24w33a

24w34a

Retrieved