#Ammount of itemtype in chest inventory

1 messages · Page 1 of 1 (latest)

proper berry
#

I have a chest inventory (gui) that is stored in a variable associated with the player. How can i count the number of (for example stone) in the inventory?

Ive tried this:

every second:
    loop {players::*}:
        set {upkeep::%loop-value%} to ammount of stone in {baseStorage::%loop-value%}

And this:

function countItems(inv:inventory,item:item) :: number:
    set {_count} to 0
    loop items in {_inv}:
        if loop-item is {_item}:
            add item ammount of item loop-item to {_count}
    return {_count}

every second:
    loop {players::*}:
        set {upkeep::%loop-value%} to countItems({baseStorage::%loop-value%},stone)

Also searched on google for 2 days.... Found nothing that worked.

I am running 1.20.1 Skript 2.8.4 with SkCheez, Skellet, SkEssentials, skRayFall and skBee

#

discord being wonky with the attachments smh

modern sierra
#

what's ammount?

proper berry
#

💀 fuck i typed amount wrong