mojira.dev
MC-252484

player_hurt_entity advancement detects "ghost NBT" in empty hotbar slots

If a player throws out an item using Q, until the hotbar slot changes again, a player_hurt_entity advancement trigger will detect the NBT data the thrown item possessed as though the player still has that item in their hand. This "ghost data" is persistent in that specific hotbar slot until the player relogs or an item is put into that slot.

To reproduce, load the attached datapack, and run this command:
/give @s stone{Test:1}

Hit any entity with the resulting item, and you'll see the advancement function say "Trigger!" and "Found!" in chat.

Press Q to throw away the item, then hit an entity with that same now-empty hotbar slot selected. You'll still get the advancement saying "Trigger!" in chat. (It will not say "Found", as that's run by an execute if data entity @s command that sees you don't have an item with the test data selected.)

Attachments

Comments 1

Thank you for your report!
We're tracking this issue in MC-229882, so this ticket is being resolved and linked as a duplicate.

That ticket has already been resolved as working as intended, which means this is not considered a bug and won't be fixed. Please do not leave a comment on the linked ticket.

If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
-- I am a bot. This action was performed automatically! The ticket was resolved by one of our moderators, and I left this message to give more information to you.

GrifterMage

(Unassigned)

Unconfirmed

(Unassigned)

1.18.2, 1.19 Release Candidate 2

Retrieved