Method of Player
player:count
Returns how many of an item the player carries, across every slot.
player:count(item: ItemMatch) → number
Parameters
itemItemMatchReturns
numberUsed in
player:count("iron_ingot") -- how many of one item, across every slot; see "items of your own" for what matchesPlayers`player:give`, `player:take`, `player:inventory` and `player:count` work onPlayersplayer:count({ id = "copper_ingot" }) -- every copper ingot they carryItemsplayer:count("brick") -- plain bricks only, never a copper ingotItems