Permitting only a specific actor to use "Item" in battle

I'm using a short plugin to hide the Item command in battle for the entire party depending on a switch:

Code:
(function() {
    var addItemCommand = Window_ActorCommand.prototype.addItemCommand;
    Window_ActorCommand.prototype.addItemCommand = function() {
        if (!$gameSwitches.value(136)) { addItemCommand.call(this) }
    }
})();

But I now realize I will need to hide the item command only for specific actors.

I'm actually not sure if there are ways to do this within stock MV.

Might anyone know how to make this work, either via alterations to the plugin or using built-in methods?

Many thanks!!
Maybe this suits you: https://forums.rpgmakerweb.com/index.php?threads/exp-potions-item-restrictions.165864/
there are several "command manager" type plugins that allow you to give different actors different command menu in battle.
If I remember correctly both tsukihime and yanfly have one, but I don't know if yanfly's is still free or not, you can check himeworks.com first.

Thanks for this -- from what I can tell, this just restricts certain items from being used?

I'm not sure, but does it permit removing the Item command in battle entirely?

there are several "command manager" type plugins that allow you to give different actors different command menu in battle.
If I remember correctly both tsukihime and yanfly have one, but I don't know if yanfly's is still free or not, you can check himeworks.com first.

Thanks @Andar it looks like the Yanfly Battle Commands is for VX and hasn't been redone for MV so far as I can tell. But you're right, Hime's Actor Battle Commands does purport to do this.

It's a bit unfortunate, since my entire plugin ecosystem seems to hate Hime's plugins 😛 But I reckon I can make it work. If anyone has any other solutions please do let me know -- I'll mark as solved in a couple days if that's okay :LZSsmile:
Thanks for this -- from what I can tell, this just restricts certain items from being used?

I'm not sure, but does it permit removing the Item command in battle entirely?
When you put <Cannot use Items> to an actor or class, then the item command is removed for this actor. However, you cannot control it via switch - the notetag is permanent.
When you put <Cannot use Items> to an actor or class, then the item command is removed for this actor. However, you cannot control it via switch - the notetag is permanent.

Works perfectly!!! I no longer need the switch control so this is just right.

You've saved me so much trouble, thank you very much :LZSkiss:

Thanks @Aerosys thanks @Andar.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/permitting-only-a-specific-actor-to-use-item-in-battle.170686/