mojira.dev
MC-121900

Player data output does not show SelectedItem and is invalid in a data path

The bug

I wanted to use SelectedItem tag for my built, but when used /data get entity KrolixWormix, tag wasn't there.

Linked issues

Attachments

Comments 15

Does the tag still function though?

I'm asking because this tag is not actually saved, and a in-memory state of a combination of SelectedItemSlot and Inventory.

It was useful on other versions( still functions on 17w43a/b). On 17w45a/b you also can't detect any non-integer player NBT tag.

On 17w45a/b you also can't detect any non-integer player NBT tag.

Not true:

execute if entity @a[nbt={SelectedItem:{id:"minecraft:bow"}}]

It still works fine, as I said, it's an in-memory tag only, and as such is not printed in the output.

I'm leaving it open though, just so the devs will consider to print it regardless.

Oh, that how it works.. Thank you. But player has no SelectedItem. And SelectedItemSlot + Inventory not the same. Because SelectedItem was slot-independent

Read my message again

this tag is not actually saved, and a in-memory state of a combination of SelectedItemSlot and Inventory.

I'm not saying it's the same, I'm saying that that in-memory tag is created by looking at the selected item slot, getting the data from the inventory in the same slot, and remove the slot tag.

5 more comments

Still the case in 18w03b

Also the case in 18w05a and 18w07c.

Still in 18w10d

i can unfortunately confirm this is still here even in 18w20c 😞

 

Also in 18w21a

KrolixWormix

migrated

Confirmed

Minecraft 17w45b, Minecraft 17w50a, Minecraft 18w01a, Minecraft 18w03b, Minecraft 18w07c, Minecraft 18w10c, Minecraft 18w10d, Minecraft 18w11a, Minecraft 18w20c, Minecraft 18w21a

Minecraft 18w22a

Retrieved