#Dropping items from an array

1 messages · Page 1 of 1 (latest)

plain oriole
#

What is the best way to drop items from an array ?
For now, i'm going through the array , copying each element to a secundary one, giving it a slot tag. When the new array length reaches 27, I stop. I then copy this new array into a shulker box and use the /loot command to get its content.

#

I know the array is at most 41 items long (can contain up to a full inventory)

queen hull
#

loop through the array, for each object in the array summon an item

gilded cloud
#
  1. Copy into storage
  2. Loop through using remove … [-1]
  3. on each step spawn the item
  4. do that 27 times or recursively until you reach 27
#

Got a similar system in a released data pack of mine

queen hull
#

Yeah essentially what I was saying

plain oriole
#

So summoning items won't have much more impact than looting a shulker box only once ?

gilded cloud
#

Since you end up spawning 27 items aswell I don't think it makes much of a difference (the spawning part)

#

But you'd need to test that I guess

#

Plus you don't need a shulker for the proposed solution and don’t need to forceload a chunk or smth