So, I am doing inventory on arrays, however, on the Internet I did not find a single necessary guide for what I need. Since I am not a very good programmer, I ran into problems at the stage of writing the item data to the inventory array.
The problem is that no matter how perverted I am, the values change in the entire array completely. That is, an array full of zeros is replaced with an array full of ones - although I only want the first satisfying value to be replaced. How can I solve this problem?
{"is-c3-clipboard-data":true,"type":"events","items":[{"eventType":"block","conditions":[{"id":"for-each-element","objectClass":"Inventory","parameters":{"axes":"xy"}}],"actions":[],"children":[{"eventType":"block","conditions":[{"id":"compare-at-xy","objectClass":"Inventory","parameters":{"x":"Inventory.CurX","y":"Inventory.CurY","comparison":0,"value":"0"}}],"actions":[{"id":"set-at-xy","objectClass":"Inventory","parameters":{"x":"Inventory.CurX","y":"Inventory.CurY","value":"ui_item.IID"}},{"id":"stop-loop","objectClass":"System"}]}]}]}
{"is-c3-clipboard-data":true,"type":"events","items":[{"eventType":"block","conditions":[{"id":"for-each-element","objectClass":"Inventory","parameters":{"axes":"xy"}}],"actions":[],"children":[{"eventType":"block","conditions":[{"id":"compare-at-xy","objectClass":"Inventory","parameters":{"x":"Inventory.CurX","y":"Inventory.CurY","comparison":0,"value":"0"}}],"actions":[{"id":"set-at-xy","objectClass":"Inventory","parameters":{"x":"Inventory.CurX","y":"Inventory.CurY","value":"ui_item.IID"}},{"id":"stop-loop","objectClass":"System"}]}]}]}