Disable 'Attack' command when no weapon is equipped

Basically, I want my characters to only be able to attack when holding a melee weapon. When they are not equipping something, the 'Attack' command is sealed. But I can't find an option to do that, I thought I'd seal the command with the role attributes, and then add the ability via weapons. But that didn't work.

I also found that I can remove the command in the .js file, but that's not what I want because it removes the ability entirely.

Any idea how to do it?
Well, you could try requiring one of two weapon types. If that works, you could probably script it. If that doesn't work, you're probably coming up against some special behavior because it's skill #1.
If you have more than two weapon types, so that the built-in requirements don't work for you, you could try either any of the actor command plugins or a skill plugin.

For example, Yanfly's Skill Core ought to work if you do:
Code:
<Custom Requirement>
value=!user.isActor() || user.weapons().length;
</Custom Requirement>

I think that should do it, because I've seen people talk about Attack getting greyed out if they add a TP/MP cost that isn't met.
Both the attack and the Guard command are hardcoded overrides - the tips above might work, or it might be that the override forces attack to be available.

However there is an alternatice approach - you can use a command manager type plugin that allows you to change the way the command menu is handled on an actor base.
with that plugin you can remove the basic attack button and add a skill button for a different Skill (like #3) there, and that replacement skill could pretend to be Attack by using the same name, but without the hardcoded restrictions.

Original thread: https://forums.rpgmakerweb.com/threads/disable-attack-command-when-no-weapon-is-equipped.158402/