mojira.dev
MC-64474

A command block item with a display Name set sets the placed block's customname when a player places, but not when a dispenser does

A command block item with display:{Name:"Blah"} when placed by a player will create the block with a CustomName "Blah", however when placed by a dispenser the block has no CustomName applied.

Related issues

Comments

qmagnet

I'm not entirely sure I understand what you mean. I renamed a command block and place the NBT tagged command block in a dispenser and it came out properly.

migrated

If you summon a block as follows:
/summon Item ~ ~ ~ {Item:{id:command_block,Count:1,tag:{display:{Name:"Blah"}}}}

The blockdata of the block when placed by a player:

{CustomName:"Blah",Command:"",x:3,y:1,z:13,id:"Control",SuccessCount:0,TrackOutput:1b,}

The blockdata of the block when placed by a dispenser:

{CustomName:"@",Command:"say hi",x:5,y:1,z:13,id:"Control",SuccessCount:1,TrackOutput:1b,}

So in summary, the game seems to automatically apply the display Name parameter to the CustomName parameter when a player places the block, but does not copy this value when a dispenser places the same block. The difference in successcount in the two outputs above is because the block was executed when dispensed.

qmagnet

Ah. Yes confirmed. Put this in your description.

Steps to reproduce
1. Type this command

/summon Item ~ ~1 ~ {Item:{id:command_block,Count:2,tag:{display:{Name:"Blah"},BlockEntityTag:{Command:"/say hi"}}}}

2. Place one on the ground and one in a dispenser

3. Activate the dispenser

4. Activate both command blocks

Result:
The custom name is removed from the command block being dispensed.

qmagnet

Also your bug title could be clarified a lot. I suggest changing it to:
dispensers remove NBT display tags from command blocks when activated

migrated

The dispenser does not appear to be removing anything - this is about the transition from an Item in inventory to a block. The display name of the item and the CustomName of the block are two different tags, are they not? If you place a CustomName in the BlockEntityTag, the dispenser will place the block with the CustomName set. Placed blocks do not have the tag for display name.

It seems to me that this is a case where what happens when the block is placed is not consistent between players and dispensers, not that the dispenser is stripping anything.

qmagnet

I'm trying to make your bug easier for others to test. Try my steps. They replicate exactly what you are talking about. When a command block is dispensed, the name reverts back to [@]

If you'd like you can retitle the bug
names tagged to command blocks with NBT are not present when dispensed

marcono1234

Confirmed for:

  • Minecraft 1.8-pre 2

migrated

Dupe of MC-1981

migrated

(Unassigned)

Unconfirmed

Minecraft 14w31a, Minecraft 14w32d

Retrieved