how can i prevent item destruction in a custom ui?
i made a custom ui checking if a slot in the chest minecart has a certain item with a custom data in it and if not, replacing it with the item(execute unless data entity @e[limit=1,type=chest_minecart,tag=forge_ui] {Items:[{Slot:0b,id:"minecraft:stick",tag:forge_ui}]} run item replace entity @e[type=chest_minecart,tag=forge_ui,limit=1] container.0 with stick[custom_data={forge_ui:1},item_model="namespace:empty"])
and then clearing any item that has that custom data from all player. the problem is that if a player has an item in the cursor spot and they click on one of these items, it'll get replaced with the stick. how do i prevent that? i thought of storing the uuid of the player opening the chest along with the components, id, and count of the item in that slot and then giving an item with the same components, id, and count to the player using the uuid but i cant store strings in storage and i dont want to store every possible component path for every possible slot. anyone got a more elegant solution?
Continue to help post