fabric-carpet icon indicating copy to clipboard operation
fabric-carpet copied to clipboard

[scarpet script] How can I interact with the inventory from a shulker box item?

Open szdytom opened this issue 1 year ago • 3 comments

Currently, inventory_* functions only accepts block, entity or gui system as a paramter. Making it accepts nbt will be very useful.

szdytom avatar Jul 07 '23 00:07 szdytom

but not every inventory_* functions could work on nbt...... for example, inventory_size(nbt) is not well defined🤔...since inventory size is not stored in nbt..... and inventory_remove(nbt) will change its argument...

a=somenbt;
inventory_remove(a);

and a got changed after that? i dont know if that is what you want....

ch-yx avatar Jul 07 '23 16:07 ch-yx

a can be a l-value so most inventory_ functions will work. What I want actually is to easily operate the inventory of shulker box item.

szdytom avatar Jul 08 '23 10:07 szdytom

That you could do with a scarpet script, no? Just grab the inventory items and use parse_nbt() to turn it into a regular string, and that's it.

Ghoulboy78 avatar Aug 04 '23 15:08 Ghoulboy78