MV (YEP_ItemCore) How to get total independent items in player inventory as a variable?

As the title states, I want to check how many independent items total there are in the player's inventory, so I can covert it into a variable and make certain enemy drops/chest items unobtainable if the player's inventory is full. (Because this plugin is by default coded to ignore the item cap when items are granted through monster drops or events)
I already know how to do everything else necessary, but the one thing stopping me is not knowing which line in the plugin is the variable for total items in the player's inventory.

I was hoping the plugin itself had a lunatic code specifically for independent item inventory count in the manual but I couldn't find any, does anyone know what it is?
It's not specific to the Item Core.

You choose in the plugin parameters whether each category (Item, Weapon, Armor) is independent.

Then you can use the default script calls to get how many of those items the party has, and they are necessarily independent.

According to the pinned thread of MV script calls, there's $gameParty.items(), $gameParty.armors(), and $gameParty.weapons().

If everything is marked as independent, you can just do $gameParty.allItems().

You'd use the .length property to get the count, so for example you could look at $gameParty.weapons().length + $gameParty.armors().length
Yes this worked perfectly! It even ignores items placed in the magic storage which is great! Thanks a ton! Didn't realize it was the .length part I was missing lol
1709323851155.png
Just to clarify: the method Turan described is only suitable for independent (or unique) item categories.

E.g. $gameParty.items() returns an array with 1 record per Item ID in inventory. With independent items, each item instance gets its own ID, so the array's length is equal to the number of inventory Items.

Without plugins, if you had 2 Potions and nothing else, $gameParty.items().length would return 1. You could do something like this to actually count all Items, Weapons, and Armors in the inventory:
JavaScript:
$gameParty.allItems().reduce(
  function(a, c) { return a + $gameParty.numItems(c); }
, 0);
Just to clarify: the method Turan described is only suitable for independent (or unique) item categories.

E.g. $gameParty.items() returns an array with 1 record per Item ID in inventory. With independent items, each item instance gets its own ID, so the array's length is equal to the number of inventory Items.

Without plugins, if you had 2 Potions and nothing else, $gameParty.items().length would return 1. You could do something like this to actually count all Items, Weapons, and Armors in the inventory:
JavaScript:
$gameParty.allItems().reduce(
  function(a, c) { return a + $gameParty.numItems(c); }
, 0);
Oh don't worry, the method they showed is pretty much exactly what I was looking for! Thanks though lol

Original thread: https://forums.rpgmakerweb.com/threads/yep_itemcore-how-to-get-total-independent-items-in-player-inventory-as-a-variable.166360/