The bug
Some items which can be used to place the respective entity in the world do not apply the custom item name to the entity. This means once you destroy the entity and pick it up as item it will not have a custom name anymore.
This was fixed for:
minecartsarmor stands(23w03a)boatchest_boat(MC-249408)ender_pearleye_of_enderfirework_rocket
Affected items / entities
ender_crystal
fishing_bobber (from fishing rod)
item_frame / glow_item_frame
leash_knot
painting
Code analysis
Code analysis by @unknown can be found in this comment.
Related issues
is duplicated by
relates to
Attachments
Comments


This is a dupe of MC-1981. Someone changed the title to make it misleading. Its not just arrows.


It also happens in 1.9

Is this still an issue in the latest snapshot 16w44a? If so please update the affected versions.
This is an automated comment on any open or reopened issue with out-of-date affected versions.

Confirmed for:
armor_stand
item_frame
ender_crystal
firework_rocket(keeps data as an item though? as if dropped onto the floor)
leash_knot(idk if that's valid/worth looking at but I'm testing them now anyway 😛)
oak_boat(haven't tested the others...)
eye_of_ender_signal
ender_pearl
fishing_bobber (from fishing rod)
painting
in 18w02a
Confirmed for 18w31a
Confirmed for 18w32a

I also confirm it for 18w32a. Renamed a fleet of boats by Greek alphabet only to find out the bug 😞
Confirmed for 18w33a
Confirmed for 1.13.1-pre1

Would be nice if the boat names worked. I'm sentimental.

Still an issue with Armor Stands in 1.14.4, which breaks the datapack I'm working on. I assume other items/entities are also broken.
[media]
Affects 1.16.1 and 20w29a.

Â
The reason this happens for the majority of entities is that the calls to drop the items are just for the item name, and don't store NBT data.
This could be fixed by instead of just spawning in a blank item this.dropItem(Items.PAINTING);
, the game also added the CustomName as NBT.
An example of this occurring can be found below:
The following is just for the Boat item and was decompiled using the Yarn mappings and CFR.
In net.minecraft.entity.vehicle.BoatEntity
, the condition for the boat to break is declared.
public boolean damage(DamageSource source, float amount) {
if (this.isInvulnerableTo(source)) {
return false;
} else if (!this.world.isClient && !this.removed) {
this.setDamageWobbleSide(-this.getDamageWobbleSide());
this.setDamageWobbleTicks(10);
this.setDamageWobbleStrength(this.getDamageWobbleStrength() + amount * 10.0F);
this.scheduleVelocityUpdate();
boolean bl = source.getAttacker() instanceof PlayerEntity && ((PlayerEntity)source.getAttacker()).abilities.creativeMode;
if (bl || this.getDamageWobbleStrength() > 40.0F) {
if (!bl && this.world.getGameRules().getBoolean(GameRules.DO_ENTITY_DROPS)) {
// This is the line that drops the boat item.
this.dropItem(this.asItem());
}
this.remove();
}
return true;
} else {
return true;
}
}
As you can see, the Boat item is dropped using a call to this.dropItem
. However, this.asItem
does not store the CustomName or any NBT at all, it's just a switch to determine the type of item.
Â
The method is seen below.
Â
public Item asItem() {
switch(this.getBoatType()) {
case OAK:
default:
return Items.OAK_BOAT;
case SPRUCE:
return Items.SPRUCE_BOAT;
case BIRCH:
return Items.BIRCH_BOAT;
case JUNGLE:
return Items.JUNGLE_BOAT;
case ACACIA:
return Items.ACACIA_BOAT;
case DARK_OAK:
return Items.DARK_OAK_BOAT;
}
}
Â
This could be fixed by changing the item to add in the CustomName NBT into its display.Name
nbt.
Â
Removed bed from the list as this is not placed as an entity.
Can confirm in 21w03a.
Can confirm in 21w05b.
Can confirm in 21w06a.
Can confirm in 21w07a.
I've attached an example video.
Can confirm in 1.16.5 and 21w08b.
Can confirm in 21w11a.
Can confirm in 21w15a.
Can confirm in 21w17a.
Can confirm in 1.17.
Can confirm in 1.17.1.
Can confirm in 1.18.1.
Can confirm in 1.18.2 and 22w12a.
Can confirm in 1.19.
Can confirm in 1.19.2.

Armor stands were fixed in 23w03a.

Can confirm in 1.20.2 & 23w43b

boats and chest boats keep their name when placed and broken in the latest snapshot (24w12a). Same with Eye of enders, enderpearls, and fireworks rockets also keep their name when thrown / placed. I don't know when these were fixed but they are
I can confirm that end crystals, paintings, item frames / glow item frames, leads / leash knots, fishing rod bobber (fishing rod name),