The bug
Minecarts with command block don't output their default or customized name after re-log.
Reproduction steps
Rename a command block minecart item
/give @s command_block_minecart{display:{Name:"\"test\""}}
Place it on a powered activator rail
Enter a command, e.g.
/say message
✔ It prints "[test] message" in chat
Reopen the world
❌ It prints "[@] message" in chat
Code analysis
Code analysis by @unknown can be found in this comment.
Related issues
is duplicated by
relates to
Attachments
Comments


Confirmed.

Still a concern in 1.7.4/5 and 1.8

Maybe the renaming is associated with the minecart but not with the command block...

Confirmed for 14w21b
Maybe relates somehow to: MC-56132


Please link to this comment in the description
The following is based on decompiled version of Minecraft 1.8 using MCP. All method and class names are the names used in the decompiled version.
The reason why this happens is that objects of the net.minecraft.entity.EntityMinecartCommandBlock.EntityMinecartCommandBlock
class have a net.minecraft.command.server.CommandBlockLogic
object to be able to run commands. All entities have the CustomName
tag however this class has a CustomName
tag as well that is used for the name of the command block that is displayed when a command is executed. When a command_block_minecart
item is placed on a rail, only its CustomName
that all entities use is set, however not its CustomName
used for commands. Once the entity is saved, the CustomName
used for commands overrides the CustomName
that all entities use. As the first one (that is used for commands) was never set to the custom name, it saves the default name "@
".

This has been fixed partly. It now outputs its name, but defaults back to @
after re-login.

seems fixed

No, this issue still occurs in 20w21a

Affects 1.16.1

Affects 1.16.1 and 20w29a

In 1.16.2 Pre-3
Can confirm in 20w51a.
Can confirm in 21w03a.
Can confirm in 21w05b.
Can confirm in 21w06a.
Can confirm in 21w07a. Video attached.

Affects 21w18a

Affects 1.17
Can confirm in 1.17.1.

Affects 21w40a
Can confirm in 1.18.1.
Can confirm in 1.18.2 and 22w18a.
Can confirm in 1.19 and 22w24a.

Cannot reproduce in 1.21.2 Pre-Release 3
Tested with experimental minecart improvements datapack enabled.