Minecraft – How to detect the item that is being “grabbed” by a player in the GUI

minecraft-commandsminecraft-java-edition

In the GUIs of chests, furnaces, anvils, etc., or just your own inventory, you click on an item to pick it up, and click again to put it into a slot of your inventory or the container block.

What is the NBT tag that returns a copy of the data of the item currently selected and moving with the cursor, and how would we modify it?

I am curious because several maps involve clicking on items to navigate an interface, and I am curious because the items that the player clicks on don't end up "grabbed."

Best Answer

Not an exact answer but just an idea. You could save the containers nbt with the data command and then check if its different in the next tick using functions or repeating command blocks.