The bug
Renamed minecarts still drop a minecart item in creative mode. Expected behavior would be not to drop a minecart.
How to reproduce
Rename a minecart
Punch it
→ ❌ It still drops its item on creative
Code analysis
Code analysis by @unknown can be found in this comment.
Related issues
is duplicated by
Attachments
Comments


Confirmed.
This Happens To all minecarts
I would think this is a good feature if the minecart keeps its name data when placed, and drops itself as a named item when you break it, but if not, then it's got to be a bug.

Confirmed for 14w21b
Unnamed minecarts with command blocks don't drop something
Can someone update the title to include creative? It's confusing otherwise. If you were in survival, it would make sense. I know that you are in creative, but it was initially confusing.
Done, thanks.
Confirmed for 15w35c. I also want to note, that when done with a minecart command block, it will drop a minecart named "@".
That's MC-41893.
I resolved MC-41893 as a duplicate of this ticket since they're the same (command block minecarts are named minecarts too!).
Confirmed for 15w39c
Confirmed in 15w40b
Still present in 15w41b
Confirmed for 15w42a
Confirmed for 15w43b and 15w43c
Confirmed for 15w44a and 15w44b
Confirmed for 15w45a
Confirmed for 15w47a and 15w47c
Confirmed for 15w51b
Confirmed for 16w05b
Confirmed for 1.9-pre1

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.
This behaviour could be changed by modifying the public boolean attackEntityFrom(DamageSource source, float amount)
method of the net.minecraft.entity.item.EntityMinecart
class. However as this is done on purpose this bug might be "Works as Intended".
/**
* Called when the entity is attacked.
*/
public boolean attackEntityFrom(DamageSource source, float amount)
{
if (!this.worldObj.isRemote && !this.isDead)
{
if (this.func_180431_b(source))
{
return false;
}
else
{
this.setRollingDirection(-this.getRollingDirection());
this.setRollingAmplitude(10);
this.setBeenAttacked();
this.setDamage(this.getDamage() + amount * 10.0F);
boolean var3 = source.getEntity() instanceof EntityPlayer && ((EntityPlayer)source.getEntity()).capabilities.isCreativeMode;
if (var3 || this.getDamage() > 40.0F)
{
if (this.riddenByEntity != null)
{
this.riddenByEntity.mountEntity((Entity)null);
}
// Changed this
//if (var3 && !this.hasCustomName())
if (var3)
{
this.setDead();
}
else
{
this.killMinecart(source);
}
}
return true;
}
}
else
{
return true;
}
Confirmed for 1.9-pre2

Confirmed for 17w17a
Confirmed for 1.13-pre5
Confirmed for 1.13.1.

Affects 18w47b

Affects 18w48a

Affects 18w48b, can I request ownership of the ticket?

Affects 18w49a

Affects 18w50a
Changed the reporter to @unknown.
I have the same =)

In 1.16.2 Pre-3