How to use Events to equip an item in a second Weapon slot?

Hi, recently just got RPG Maker MV and am trying to put together my first game.

I've used Yanfly's EquipCore plugin to add a second weapon slot, and I can manually equip weapons in this second weapon slot, but I cannot use the Change Equipment event command to equip weapons into this second weapon slot. It just claims the second weapon slot has no valid items.

Originally what I really wanted was a way to have melee weapons in the first slot and ranged weapons in the second, but I gave up on that idea. However, I cannot give up on this aspect, at least; it needs to work this way at minimum. Given that I'm using a plugin, I'm guessing that editing/adding to the plugin is the only way to resolve this, but I'm not that familiar with JS.

Any suggestions?

Thanks
I’ve moved this thread from RPG Maker MV to JavaScript/Plugin Support.
As you've seen, plugins modify the game, not the editor. However, you may be able to use a core script call instead to work around that, e.g. in a Script command:
JavaScript:
$gameActors.actor(1).changeEquipById(2, 3);
This says: "equip armor/weapon ID 3 into equip slot 2 of actor ID 1". (Here, the first equip slot is slot 1.)

Alternatively, by the actor's position in the party:
JavaScript:
$gameParty.members()[0].changeEquipById(2, 3);
I.e. "equip armor/weapon ID 3 into equip slot 2 of the first member of the party". For the second party member, replace 0 with 1, etc.
Thank you, that has solved the problem. I also didn't know you could use snippets of JS code in that way, I assumed I'd have to edit the plugin file. I really ought to look into the JS side of things more...
Great, you're welcome! 👋

Original thread: https://forums.rpgmakerweb.com/threads/how-to-use-events-to-equip-an-item-in-a-second-weapon-slot.160695/