mojira.dev
MC-69458

/blockdata overwrites complete inventory structure

I am sorry if this is a duplicate and also when this works as intended, but I thought the blockdata has the funktion to change partwise NBT data of blocks
So when you use the blockdata command to change for example the name, the other NBT tags like "lock" don't get overwritten, so I guess items also shouldn't overwrite everything

How to repdroduce:

  1. Place a dispenser and fill it with some items

  2. Stand on top of the dispenser and perfrom this command:

    /blockdata ~ ~-1 ~ {Items:[0:{id:stone,Count:1,Slot:4,Damage:0}]}

    You will see, that the dispenser only contains the stone anymore, but the other items are gone

This should instead be made by this command:

/blockdata ~ ~-1 ~ {Items:[0:{id:stone,Count:1,Slot:4,Damage:0},1:{Slot:0},2:{Slot:1},3:{Slot:2},4:{Slot:3},5:{Slot:5},6:{Slot:7},7:{Slot:8}]}

Linked issues

Comments 5

Possibly Working as Intended. You can replace individual slots with /replaceitem. The current /blockdata behavior makes it possible to reset the contents of a chest, by adding and removing items. Changing this would make it impossible to wipe a chest with /blockdata, and you would need to use a separate command to first destroy the chest (/blockdata was most likely added to prevent the need for that, in the first place).

The current behavior of /blockdata and /entitydata are to merge changes to compounds (the curly-brace groups), but completely overwrite lists (the square-bracket groups). It's possible to "overwrite" a compound by replacing every tag with the desired value. If lists were not overwritten by default, you would either have to explicitly label indices (which is currently optional), or unlabeled indices would have to be appended to the end of the list. This would still make it impossible to remove elements from a list, however.

Can be closed 😞

Sorry for this spam but it was necassary... 😞

I think this is a bug. Entitydata will only change the value of the specified tag, without affecting other tags. Why should blockdata work any differently?

marcono1234

(Unassigned)

Unconfirmed

blockdata, container, dispenser, item, overwrite

Minecraft 1.8-pre2

Retrieved