mojira.dev
MC-53850

Invulnerable item entities and experience orbs are removed client-side when they take damage

The bug

Invulnerable item entities and XP orbs disappear / are removed from the world client-side when they take damage. However, they are still in the world server-side and once the player gets close to them he collects them.

How to reproduce (item)

  1. Summon an invulnerable item entity

    /summon item ~2 ~ ~ {Invulnerable:1b,Item:{id:"stone",Count:1b}}
  2. Ignite the block below it with a Flint and Steel and put out the fire afterwards
    → The item is not visible anymore

  3. Move towards the position the item was
    → It is still there and you can collect it

How to reproduce (XP orb)

  1. Place a command block with the following command

    /summon armor_stand ~ ~ ~ {Invulnerable:1b,Passengers:[{id:"experience_orb",Value:10s,Invulnerable:1b}]}
  2. Set the top of the command block on fire and put out the fire afterwards
    → The XP orb is not visible anymore

  3. Move towards the position the XP orb was
    → It is still there and you can collect it

Types of damage

  • Fire

  • Lava

  • Cactus

Code analysis

Code analysis by @unknown can be found in this comment.

Attachments

Comments 40

The Item Entity is flagged as Invulnerable in the NBT Tags and therefore should not be affected by the fire, also it does not go away as you said, in the screenshots you can clearly see that the same Item Entity still exists in the world it just isn't getting rendered/shown.

I've alwasy considered the Invulnerable Tag as a way to create Entities that can only be damaged by /kill or by the Void, that's why I think the fire should not affect the Item Entity if it's invulnerable. Also, the Invulnerable Tag works like a boolean (but it's TAG_Byte), so anything with Invulnerable:1 is invulnerabe forever. You can confirm that easily by spawning an invulnerable Cow (for example), waiting for a while and then hitting it (you have to be in Survival, because you can damage invulnerable mobs in Creative). I've tested your suggestion anyway and I had the same results like the ones that I put into the report (Item Entity is still there, but invisible when set on fire). So I guess it's not invalid, but either the Item Entity should get deleted, or it should stay visible.

Confirmed for 14w21b

The item stops rendering but can still get picked up

MC-51195 happens when you hit a mob with the Invulnerable Tag while you're in creative mode. This happens when you set an invulnerable item on fire. If I set a cow with the invulnerable tag on fire neither does it stop rendering nor does it take damage, it takes no damage at all, no matter if I'm in creative mode or survival mode.

But I've still tested your suggestion Blah and the item stops rendering, no matter if I'm in creative mode or in survival mode. Therefore my report is not invalid.

Blah, stop linking incorrect issues please!

The "Invulnerable" tag says if the item can get killed/destroyed (exeptions: Player in creative/"/kill" command). This is for all kind of damage which means it is not destroyable by lava, fire, tnt, hits, drowning...

First of all, when the item would really get destroyed, it would be incorrect because it should be immune against every kind of damage (with exeptions).
Second like I wrote and the other users here too, you can still pick it up, water makes it visible again and reloading also works to make it visible, so this is neither a duplicate nor invalid.

30 more comments

Can confirm in 1.17.1.

Can confirm in 1.18.1.

I can no longer reproduce this in 22w07a, looking at the diff, this was fixed at the same time as MC-246465

I can confirmed fixed in 22w07a

o1oo11oo

CreeperMagnet_

(Unassigned)

Confirmed

Low

Entities, Networking

entity, experience_orb, invulnerable, item, rendering

Minecraft 14w11b, Minecraft 14w17a, Minecraft 14w18a, Minecraft 14w25b, Minecraft 14w28a, ..., 21w17a, 1.17 Pre-release 1, 1.17, 1.17.1, 1.18.1

22w07a

Retrieved