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
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
is duplicated by 3
relates to 2
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`
Can confirm.