mojira.dev
MC-2756

Possible to put stacked sword in the anvil

The bug

You can put stacked items that normally aren't stackable into the anvil, expected it to just put one item into the anvil. (Video by @unknown)

How to reproduce

  1. Give yourself 64 swords, and one enchanted sword.

    /summon minecraft:item ~ ~ ~ {Item:{id:"diamond_sword",Count:64b}}
    /give @p diamond_sword{Enchantments:[{id:sharpness,lvl:3},{id:fire_aspect,lvl:1},{id:looting,lvl:3},{id:sweeping,lvl:3},{id:unbreaking,lvl:1}]}
  2. Put the illegal stacked item in the anvil.
    → ❌ Puts the 64 swords in the anvil, should put only one as its not stackable

  3. Put the enchanted sword in the second anvil slot.
    → ❌ It valids the process; you can apply the enchantments to the 64 swords.

Linked issues

Attachments

Comments 20

This is because tools and armour cannot be stacked. To achieve this, you would have to either use a mod, or edit the game files.

You can also get a stack of swords by using
/give NAME 276 64

so I guess this bug should be reopened. Also, changing the anvil code to prevent stacked repairs or to calculate the correct cost should be quite trivial.

Jonathan, you are right. Reopened

However, its not a bad idea to rename a stack of blocks cheaply; forcing users to individually rename dirt for example in an adventure map would be tedious for map makers, I have no idea why you would want a stack of swords unless they were all the same, again this is only relevant for map makers who would be the only people to use this.

The issue here is not to put stacked items on the anvil per se, it's using normally *un*stackable items as a stack on the anvil.

10 more comments

Can confirm in 21w05a.

Can confirm in 21w05b.

Can confirm in 21w06a.

Can confirm in 1.16.5 and 21w11a.

bruno de jesus lino

Oval

(Unassigned)

Confirmed

UI

Minecraft 1.4.2, Minecraft 1.4.4, Minecraft 1.4.7, Snapshot 13w05b, Minecraft 1.5, ..., 21w05a, 21w05b, 21w06a, 21w07a, 21w11a

Retrieved