mojira.dev
MC-64122

Testfor / scoreboard cannot find items the player has picked up with the cursor

I hope this wasn't reported already 😞

  1. Perform this command

    /scoreboard objectives add Inventory dummy
  2. Then perform this command

    /scoreboard objectives setdisplay sidebar Inventory
  3. Build a clock which runs this command:

    /scoreboard players add @a Inventory 1 {Inventory:[{id:minecraft:stone}]}
  4. Put a stone in your inventory, the score should increase, now take it with the cursor to move it

The score stopped increasing

Now even if you say this is a feature request or no bug, it is as the "/clear" command can clear this "slot".

Linked issues

Comments 12

When you click on it, its no longer in your inventory. Perhaps Mojang should add a testable slot for cursor selected item, but all suggestions should go to reddit.

that it intended behaviour, when you move it, it's not in a slot of your inventory

the clear command doesn't look at "do you hold in in a slot", it looks at "do you hold somewere"

Because clear is a universal command. But Inventory NBT is coded with the slots.

None of us are arguing.
What are you trying to prevent or achieve? There's typically a workaround, especially with the 1.8 snapshots.

2 more comments

Yes, I do not like mods. But to me, this is something that may not be able to be achieved yet. I don't consider it a bug. And I think it could be accounted for but you'd have to have Mojang make that changed based on a suggestion.

What do you think about deleting the whole conversation here, else the mods maybe will get a little bit mad at us 🙂

This does seem incongruous. Tickets such as MC-37529, MC-49062, and MC-18216 all suggest that the cursor is not part of the inventory, or the world, because items can be lost if they are held when the game closes unexpectedly. However, I don't know if that's still true since the inventory code was rewritten. It's possible that the cursor is now part of the inventory, and as such, commands that work on the inventory should be able to find it. That the clear command can find it also does suggest that it can be done.

I could not find the cursor slot in the NBT data of the players, but somewhere it must be saved...

Actually, my point was that items held in the cursor are not saved to NBT. It's obviously stored in memory somewhere, but not as part of the inventory structure. See MC-41165.

marcono1234

Erik Broes

Unconfirmed

clear, inventory, item, testfor

Minecraft 14w30c, Minecraft 14w31a, Minecraft 1.8-pre2, Minecraft 15w37a

Retrieved