How do you get and set the item that a player selects from a GUI. Eg: How do I set the selected item to Item::AIR? (Note that the item is neither in the player's inventory nor in the chest).
I want say you cant? do that? like change what player is selecting on the fly without them putting into their inventory first
I think it might be a FloatingInventory(not so sure haven't been up to par with the new API and such)
Dktapps coded that for a spoon for storing the item in such a situation, in a virtual inventory. But since it's a virtual implementation and doesn't handle things game-specific, it isn't the answer for this thread. :/
Using pocket GUI, that's the stuff i got: Code: [17:17:18] [Server thread/DEBUG]: [PacketLogger] object(pocketmine\network\protocol\ContainerSetSlotPacket)#11430 (8) { ["windowid"]=> int(3) ["slot"]=> int(0) ["hotbarSlot"]=> int(0) ["item"]=> string(20) "Item Chest (54:0)x13" ["unknown"]=> int(0) ["isEncoded"]=> bool(false) ["offset"]=> int(9) ["buffer"]=> string(18) "320300006c1a000000" } [17:17:18] [Server thread/DEBUG]: [PacketLogger] object(pocketmine\network\protocol\ContainerSetSlotPacket)#13967 (8) { ["windowid"]=> int(0) ["slot"]=> int(6) ["hotbarSlot"]=> int(0) ["item"]=> string(20) "Item Chest (54:0)x50" ["unknown"]=> int(0) ["isEncoded"]=> bool(false) ["offset"]=> int(9) ["buffer"]=> string(18) "32000c006c64000000" }
But how sure are you that it has to be that. It might've just logged the item being clicked from the GUI and not the item that isn't in either of the GUIs.
In pocket edition you do not have items in that kind of floating gui inv. I didn't have win10 edition currently available.