mojira.dev
MC-95922

Destroyed dropped Minecart items use entity name

The bug

When breaking a minecart (any type) in survival a renamed minecart item is created. In previous versions a renamed minecart was only dropped if the minecart was renamed before.

Additionally some minecart types have no translation and are displayed as: entity. + Entity type + .name
Full list:
entity.MinecartRideable.name
entity.MinecartFurnace.name
entity.MinecartTNT.name
Minecart with Chest
Minecart with Hopper

How to reproduce

Place any type of minecart and break it in Survival mode.

The reason

The following is based on decompiled version of Minecraft 1.9 using MCP 9.24 beta. All method and class names are the names used in the decompiled version.

The reason why this happens is because in previous versions the class net.minecraft.entity.item.EntityMinecart had an extra field for the custom name that would be used for dropping the item (this required a lot of methods to be overridden). In 1.9 minecarts do not have this extra field anymore. The problem is that the method net.minecraft.entity.item.EntityMinecart.killMinecart(DamageSource) uses the method net.minecraft.entity.Entity.getName() to test whether or not the minecart has a custom name. This method will always return a string because this method is used for displaying for example the entity name in the chat. Instead the method of the minecart should test if it has a custom name.

public void killMinecart(DamageSource source)
{
    this.setDead();

    if (this.worldObj.getGameRules().getBoolean("doEntityDrops"))
    {
        ItemStack itemstack = new ItemStack(Items.minecart, 1);

        // Replaced this
        //if (this.getName() != null)
        //{
        //    itemstack.setStackDisplayName(this.getName());
        //}
        if (this.hasCustomName())
        {
            itemstack.setStackDisplayName(this.getCustomNameTag());
        }

        this.entityDropItem(itemstack, 0.0F);
    }
}

Related issues

MC-95928 Destroyed and picked up minecart changes name to "entity.MinecartRideable.name" MC-96003 When minecart is destroyed by cactus and picked up the name changes to "entity.MinecartRideable.name" MC-96067 Drops of special minecarts don't have a name MC-96093 Minecart GUI displays "container.minecart" in name field MC-96266 Minecart storage name MC-96308 TNT Minecart Breakage Error MC-96415 minecart destroyed MC-96581 minecarts are not correctly named MC-96812 Minecarts MC-96817 Title in minecart hopper and minecart chest is broken MC-96914 Minecart names are messy MC-96921 Bug "container.minecart" MC-97085 Minecart Name Changing MC-97134 Minecarts Given Code-Like Names. MC-97200 Minecart Bug! MC-97202 Minecraft bug MC-97269 Naturally Spawning Chest Minecarts have "container.minecart" name text MC-97313 Minecart with Container lost the name MC-97342 Minecart Chest MC-97349 Minecart name changes when it is placed MC-97351 Minecart name changes when it is placed and then it is picked up MC-97514 MineCart shows up under container.minecart MC-97536 Minecarts are named differently MC-97594 Minecarts not working exactly as intented MC-97653 Minecarts with names MC-97690 Minecarts with chests taken from mineshafts display container.minecart MC-97788 If you break a minecart hopper, the minecart you get is named "container.minecart" MC-97790 It's written "container.minecart" in the inventory of minecart hopper & chest. MC-97838 Minecart chest GUI titled as "container.minecart" MC-97890 conatiner.minecart Shown instead of Minecart Chest, or Minecart Hopper MC-98084 Minecart name messed up MC-98106 container.minecart in the GUI of the Minecart MC-98212 Minecarts with chests found in mineshafts are labelled "container.minecart" when picked up MC-98274 Minecart names MC-98321 Unnamed Minecarts MC-98525 Minecart Bug MC-98575 MinecartChest wrong name display. MC-98581 Furnace MInecart MC-98584 entity.MinecartTNT.name MC-98617 Minecart nameing issue MC-98861 "minecart.container" when opening minecart chest MC-99021 Mine Cart Name incorrect MC-99376 After destroying minecart in survival minecart is named "entity.MinecartRideable.name" MC-99582 Buggy 'Minecart' Name After Breaking Minecart With Hand MC-99626 Opened Minecart with Chest reads "container.minecart" MC-99627 Minecart with chest and hopper read "container.minecart" when open MC-99714 Mining Minecarts give weirdly named Minecart Items MC-99738 Minecart from mineshaft has a name MC-99850 Minecarts broken in are renamed to entity.MinecartRideable.name MC-100310 Minecarts When Broken Have The Name entity.MinecartRideable.name MC-100447 Many types of minecarts are incorrectly named upon being destroyed. MC-100495 if a minecart explodes, the item dropped will be called "entity.MinecartRideable.name" MC-100564 Minecart Name Change MC-100706 Minecart bug!! MC-100735 minecart MC-101416 Minecarts keep their names after breaking MC-101423 Hopper With Minecart Bug MC-101475 Confused Minecart names MC-101485 Minecart names are broken MC-101685 The item dropped when a minecart is desroyed is named "entity.MinecartRideable.name" MC-101914 Minecart name is incorrect. shows entity.MinecartRideable.name instead MC-101987 minecart "looses" his name afther breaking it. MC-102032 Minecart with furnace has a weird name after destroying MC-102663 Item Name MC-102704 When a minecart is put in a frame after being dispensed it show its wrong name MC-103010 Breaking a minecart will call it "entity.MinecartRideable.name" MC-103045 name change of minecart / minecartfurnace by entity.MinecartFurnace.name or Entity.MinecartFurnace.name . MC-103265 Minecart with Hopper Name Problem MC-103385 Minecarts have wrong names after being placed and broken MC-103394 Running Minecart into Cactus changes name MC-103414 Minecart has not name MC-103485 Broken minecarts are named entity.MinecartRidable.name MC-103489 Minecart name different after placing and breaking MC-103579 Minecart Breaking Bug MC-103589 minecart still uses entity name MC-103698 Minecart names MC-103763 Breaking a minecart gives it a weird name MC-103851 Minecart with Hopper when broken drops minecart and hopper, but minecart will still have name "Minecart with Hopper" MC-103881 Minecrart named entity.MinecartRideable.name MC-104776 when a minecart hopper/furnace/chest is broken the minecart item isn't 'Minecart' MC-104795 Minecart with Chest-name remains MC-105002 minecart with hopper MC-105117 Minecart with chest/hopper/furnace keeps name after breaking MC-105239 Minecart rename issue MC-105419 Mine Cart-Item Hopper MC-105423 Displays wrong name. MC-105495 Minecart name glitch MC-105711 Minecart with chest displays item name when pointed to MC-106081 minecart hopper and chest droppe minecart still named "minecart with hopper" or chest MC-106110 Item name changes when used MC-106121 When destroyed by a cactus, minecart getting renamed as "entity.MinecartRideable.name" MC-106516 My minecarts are called "entity.MinecartRideable.name" after I break them MC-108524 Minecarts mined from abandon mineshafts come up as entity names MC-109265 Minecarts name changes to entity.minecart.name when broken MC-109937 Mine carts changing names into "entity.MinecartRideable.name" when broken

Attachments

Comments

migrated
[media][media][media]
FaRo1

The dropped minecarts also have this titles and it also affects minecarts with TNT or furnace.

marcono1234

The bug that the items have this name as well is probably because the name is wrong.

migrated

Confirmed for 16w04a, also the display name is not checked by the game code. What matters is that the string pointed to by container.minecart is not displaying, Marcono1234.

marcono1234

That should be covered by the first point:

The GUI of a MinecartChest and MinecartHopper both shows container.minecart. This has a translation but is despite that not translated.

[Mod] Neko

Confirmed for 16w07b

Furnace Minecarts experience a similar issue. Breaking them will drop a Minecart that's named entity.MinecartFurnace.name.

[Mod] Neko

Confirmed for 1.9 Pre-Release 1

migrated

Still an issue in 1.9 Pre-Release 2

migrated

Can confirm in 1.9 pre-2 that my minecart chests aren't translated from container.minecart.

[Mod] Neko

Confirmed for 1.9 Pre-Release 3

[Mod] Neko

Confirmed for 1.9 Pre-Release 4
Please add furnace minecarts to the list.

marcono1234

As far as I know all Minecarts (except command block ones, see MC-41893) are affected and probably because of the same bug

[Mod] Neko

Confirmed for 1.9.1 Pre-Release 1

migrated

The issue with the inventory of Minecart with Chest/Hopper is fixed in 1.9.1-pre2, the minecarts dropped still are "renamed", see description.

SunCat

@unknown, you forgot to update the version

migrated

@unknown whoops, fixed

[Mod] Neko

Confirmed for 1.9.1 Pre-Release 3

[Mod] Neko

Confirmed for 1.9.1 and 1.9.2

migrated

Confirmed for 1.9.2

1) Minecarts in dungeons with a chest after broken, is called "Minecart with Chest".
2) While a minecart is crafted, it is called "Minecart".
3) When placed on a rails, and then broken, its called "entity.etc.etc.".

This is new behaviour i havnt seen ever, just after 1.9+.

migrated

1. Already listed as affected
2. Steps are already in the description
3. It started in 1.9 development, see affected versions list

[Mod] Neko

Confirmed for 16w15a

[Mod] Neko

Confirmed for 16w15b

migrated

This bug does have the consequence that, the next time the minecart is placed, you can no longer get a villager to ride in it. I haven't tested out other aspects of this bug yet, I only discovered it when trying to move villagers around, today.

marcono1234

@unknown it is very unlikely that this is caused by this bug. What you experience is probably MC-92165

migrated

Marcono1234, after reviewing that bug, I think you are right. Honestly, I hope they fix that issue before this one (unless they get fixed at the same time)

[Mod] Neko

Confirmed for 1.9.3 Pre-Release 2

[Mod] Neko

Confirmed for 1.9.3 Pre-Release 3

Ray
[Mod] Neko

Confirmed for 16w20a

violine1101

Still in 16w21a and 16w21b

violine1101

Still in 1.10-pre1

[Mod] Neko

Confirmed for 1.10-pre2

[Mod] Neko

Confirmed for 1.10

Jens Bergensten

Fixed as according to the description. Thanks!

migrated

I made a new bug report because this is still happening and it was marked as resolved...I can no longer vote for this because of the "resolution" though

migrated

Look at the fix version, it's fixed in a 1.11 snapshot, not 1.10.

migrated

Confirmed fixed as of 1.11 release.

migrated

This has happened to me just now. It said entity.MinecartRideable.name for me too.

violine1101

@unknown Which Minecraft version did you use? This bug should be fixed as of 1.11 / 16w32a.

migrated

Is it on a server?

marcono1234

Jens Bergensten

Confirmed

GUI, item, minecart, translation

Minecraft 16w03a, Minecraft 16w04a, Minecraft 16w05b, Minecraft 16w06a, Minecraft 16w07a, ..., Minecraft 16w21b, Minecraft 1.10 Pre-Release 1, Minecraft 1.10 Pre-Release 2, Minecraft 1.10, Minecraft 1.10.2

Minecraft 16w32a

Retrieved