#how do i subtract an item inside a container instead of add??

1 messages · Page 1 of 1 (latest)

sweet locust
#

Try just doing minus 1 inside of your new item stack

#

@crimson dust

crimson dust
sweet locust
#

I don't know if any of those are going to work though I'm just thinking of possible ways to do it

crimson dust
#

so in the brackets, itemInFirstSlot.typeId, 1, just change that 1 to -1?

#

attempting it, seeing what happens

#

no that broke everything, thats not the right spot

#

chestInventory.addItem(clone - 1) also broke everything

sweet locust
crimson dust
#

im gonna have to scroll through showcase and maybe look at everyone elses problems to see if i can find a solution 😭

crimson dust
#

okay so some info

const clone = new ItemStack(itemInFirstSlot.typeId, 1);

is how i control the amount, the number 1 means its adding 1, if i change it to 5, it adds 5 blah blah blah. the thing is when i try to subtract, it doesnt work, i tried doing -1

crimson dust
#

how do i subtract an item inside a container instead off add??

#

how do i subtract an item inside a container instead of add??