#Getting Item.of() item quantity, pushing elements to an array
26 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
.count
array.push(<element>)
i missed that part 
im not sure if you can have an Item.of() with a count higher than 64
I tested it, you can
Also tyvm I'll test this out now
How would I get 'minecraft:dirt'?
wdym by "get" 
The ID. Here's the code
const assemblifyInputs = function (items){
let newItems = []; // new input list
let currentCount = 0;
items.forEach( item => { // loop through the input array
currentCount = item.count; // get the count of current item
do { // if item count is larger than max stack size, split it into multiple "item stacks"
newItems.push(Item.of(item,currentCount))
currentCount -= item.maxStackSize;
}
while(currentCount > item.maxStackSize) // push at least once in case it's not over the max stack size
})
return newItems;
}```
thats one way to define a function 
What's the best way in 1.20?
mc version doesnt matter, its just plain JS
usually you go
function whatever() {...}
or the newer way of doing it
let whatever = () => {...}
Ah I have it as a global variable so I thought const (constant) was best
Nice!! Tyvm for that
It's good, I think you've helped a lot with your feedback
i wanna help im just not sure how to interpret your question
I was interpreting it as getting the first argument part of Item.of (the item ID) which I assume is a String
yeah you just type that, or depending on how you want to use this, get it from somewhere else
I gotcha, thanks for clarifying!
