How to limit inventory slots?

I know there are lots of inventory plug-ins, but I don't really need all those functions. I just want to limit the number of slots (i.e. different items) of the player inventory to say 10 slots. It can just be for Regular Items. Same items in the slot are still stackable. Is this a simple thing where I can just change a variable? How to do that? Thanks!
If you're willing to put in the work managing variables, common events, and all of you're item gaining events you can do that. So first you'll want to make two variables: One for the Stock Limit and one for Current Stock. Stock Limit is the limit amount that you set for the inventory limit. Now in a common event, let's call it Inventory Check, you'll have to use the Current Stock variable to count every item that the player has in their inventory and add to the variable. It should look a little like something below. Now before you gain an item run the Inventory Check common event and have a conditional branch that will check the Current Inventory variable is equal to or above the Stock Limit variable. Now if Current Inventory is equal to or above the Stock Limit variable than the player doesn't get the item, if it's lower than the Stock Limit variable than they can get the item. At the end of the event make sure to set Current Inventory to 0 so it won't keep adding the current item count to the variable.
gameParty.maxItemNumber?

start there and follow the code to the item scene.
I did something similar, but I don't remember exactly what I changed.
expect to modify addItem and some equipment methods as well, for validation when dropping items to a full inventory.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-limit-inventory-slots.115362/