MZ Remove 'item' access during game?

hey devs,
I'm making a game where there is a sad final boss where you shouldnt be able to use any items. Is there a way I can remove the 'Item' button during gameplay or a battle?
Any plugin that allows for dynamic battle commands should do it.

HimeWorks had a plugin for MV that allowed you to toggle them with a plugin command - you could see if that works via FOSSIL, or if there's something comparable written for MZ.

Otherwise, it wouldn't be too hard to just do this:
Code:
Window_ActorCommand.prototype.makeCommandList = function() {
    if (this._actor) {
        this.addAttackCommand();
        this.addSkillCommands();
        this.addGuardCommand();
        if (!$gameSwitches.value(X))
            this.addItemCommand();
    }
};
where X is the ID of a switch in your game.

Save that code as a .js file in your plugins folder and add it to your plugin manager. Then when you have switch X turned on, the Items command shouldn't show up.
Any plugin that allows for dynamic battle commands should do it.

HimeWorks had a plugin for MV that allowed you to toggle them with a plugin command - you could see if that works via FOSSIL, or if there's something comparable written for MZ.

Otherwise, it wouldn't be too hard to just do this:
Code:
Window_ActorCommand.prototype.makeCommandList = function() {
    if (this._actor) {
        this.addAttackCommand();
        this.addSkillCommands();
        this.addGuardCommand();
        if (!$gameSwitches.value(X))
            this.addItemCommand();
    }
};
where X is the ID of a switch in your game.

Save that code as a .js file in your plugins folder and add it to your plugin manager. Then when you have switch X turned on, the Items command shouldn't show up.


Your JS worked for me in MZ and you saved me a lot of time. I just wanted to show my appreciation to you <3

Original thread: https://forums.rpgmakerweb.com/threads/remove-item-access-during-game.147952/