mojira.dev
MC-111744

Anvil outputs only 1 item when renaming

The bug

When renaming more than 1 item in an anvil in survival, the output will always be 1.

[media]

Code analysis

In 1.11.2, net.minecraft.inventory.ContainerRepair.updateRepairOutput() sets the output to 1 if the item is not a name tag.

ItemStack itemstack1 = itemstack.copy();

            if (itemstack1.getCount() > 1 && !this.player.capabilities.isCreativeMode && !(itemstack1.getItem() instanceof ItemNameTag))
            {
                itemstack1.setCount(1);
            }

Linked issues

Comments 2

This appears to have been a deliberate change.

Code was added to intentionally achieve a 1 output result.

Likely to handle the case of renaming stacks of 64 being a little overpowered to just cost 1, but scaling cost is ineffective due to the cap.

The main use for renaming stacks of items are for large sorting systems so that you don't have to use a common item that could break the system. Creating a sorting system that sorts 100 or more items already takes a tremendous amount of these despite being cheap to rename. Multiplying that cost by 64 will make it extremely expensive and force most to revert back to using a common item for sorting. All this will accomplish is making sorting systems more frustratingly vulnerable, it sure won't make them go away. I'm not aware of any other mainstream uses for renaming stacks that would warrant making this change. Even if this is a deliberate change hopefully there can be a compromise to renaming stacks for a much more reasonable cost?

[Mod] Neko

migrated

Confirmed

anvil, item, item-renaming, stack

Minecraft 1.11.2, Minecraft 17w06a, Minecraft 17w13a, Minecraft 17w13b, Minecraft 17w14a, Minecraft 17w15a, Minecraft 17w16a, Minecraft 17w16b, Minecraft 17w17b, Minecraft 17w18a

Minecraft 1.12 Pre-Release 1

Retrieved