Only 8 items

Is there a way to make it so that you can only have x number of items at a time? Like, not x number of each item, just x items.

A couple examples:
  • 8 of item A
  • 3 of item A, 5 of item B
  • 2 of item A, 4 of item B, 1 of item C

Thanks in advance.
By default? Not easily. You'll probably need someone to make a plug-in for you for this one as I don't know of any that exist.

Moved to Plug-in Requests due to this probably needing a plug-in

http://www.yanfly.moe/wiki/Item_Core_(YEP)

This plugin allows Independent Items, which effectively does what you're asking. Keep in mind that it counts items, weapons, and armor separately, if that's important.
@Poryg Helped me with this a couple of weeks ago. What I did is make two variables: One is the maximum inventory limit, let's say 8, and the second variable is the current inventory count. then use this script call:

var itemCount = 0;
for (var i in $gameParty._items) itemCount += $gameParty._items;
$gameVariables.setValue(x, itemCount);

And replace x with the current inventory variable. This call will check the inventory and add all items currently in the inventory to the variable count. Now when you make your event put that script call first and make a conditional branch that checks the Current Inventory Count against the Maximum Inventory Limit. If the Current Inventory Count is lower then the Maximum Inventory Limit then the player gets the item and you use the self switch to move it to the next page, if not then tell the player they don't have space for it and let the event end.
Thread closed IgnoreMe

Original thread: https://forums.rpgmakerweb.com/threads/only-8-items.113473/