mojira.dev
MC-48798

Created items disappear when I press a button

When I create an item inside a chest using a command block, specifically:
/blockdata ~ ~4 ~3 {Items:[{id:diamond_axe}]}
the item appears in the chest.

However, when I hold that item and right click, it disappears. When I left click nothing happens, and when I attack mobs, it doesn't deal any extra damage. It is as if the item is not existing.

Linked issues

Comments 2

That's because it doesn't necessarily exist. The "Count" tag, if not defined, defaults to 0, meaning you have 0 of that item in your inventory. You need to apply the "Count" tag of 1 or higher:

/blockdata ~ ~4 ~3 {Items:[{id:diamond_axe,Count:1}]}

Thank you, I will try this and most likely that was the cause of the item disappearing.
Strangely enough, the item did show up in the chest and I could hold it, so it wasn't until I right-clicked that the "count 0" kicked in.

Patrik Siljestam

(Unassigned)

Unconfirmed

Minecraft 14w07a

Retrieved