MV add a command on the menu

Hello there,

I'm trying to add a personnal command on the menu in game . But the code than I've done doesn't work. So I want to look if you have a method to add that. I'm pretty sure my way is wrong, I look on different plug in how they done but nothing work.
We can't tell you what's wrong with your code since you didn't post it for us to see. But Yanfly's Main Menu Manager plugin is designed to make it easy for you to add commands to the menu.
First, you must know where to put the command, I assume it's main menu of the game, so first step is to code that command:

Code:
    Scene_Menu.prototype.myCommand = function(){
        //Your stuff what will it do:
    }

Now, what's left it to add command entry to window and bind it with function written above.
Code:
    var commandAlias = Scene_Menu.prototype.createCommandWindow;
    Scene_Menu.prototype.createCommandWindow = function(){
        commandAlias.call(this);
        this._commandWindow.setHandler('symbol',      this.myCommand.bind(this));
    };

    Window_MenuCommand.prototype.addMyCommand = function(){
        this.addCommand('MyCommandLabel', 'symbol', true);
    };

Anyway, this is a template to add custom command to main menu in game (not game title)
JavaScript:
(function(){
'use strict';

    Scene_Menu.prototype.myCommand = function(){
        //Your stuff what will it do:
    }
   
    var commandAlias = Scene_Menu.prototype.createCommandWindow;
    Scene_Menu.prototype.createCommandWindow = function(){
        commandAlias.call(this);
        this._commandWindow.setHandler('symbol',      this.myCommand.bind(this));
    };

    Window_MenuCommand.prototype.addMyCommand = function(){
        this.addCommand('MyCommandLabel', 'symbol', true);
    };

    var mAlias = Window_MenuCommand.prototype.makeCommandList;
    Window_MenuCommand.prototype.makeCommandList = function() {
        mAlias.call(this);
        this.addMyCommand();
    };

})();
We can't tell you what's wrong with your code since you didn't post it for us to see. But Yanfly's Main Menu Manager plugin is designed to make it easy for you to add commands to the menu.
Yep I know, but I want to start fron the beginning, to make sure everything is working
First, you must know where to put the command, I assume it's main menu of the game, so first step is to code that command:

Code:
    Scene_Menu.prototype.myCommand = function(){
        //Your stuff what will it do:
    }

Now, what's left it to add command entry to window and bind it with function written above.
Code:
    var commandAlias = Scene_Menu.prototype.createCommandWindow;
    Scene_Menu.prototype.createCommandWindow = function(){
        commandAlias.call(this);
        this._commandWindow.setHandler('symbol',      this.myCommand.bind(this));
    };

    Window_MenuCommand.prototype.addMyCommand = function(){
        this.addCommand('MyCommandLabel', 'symbol', true);
    };

Anyway, this is a template to add custom command to main menu in game (not game title)
JavaScript:
(function(){
'use strict';

    Scene_Menu.prototype.myCommand = function(){
        //Your stuff what will it do:
    }
  
    var commandAlias = Scene_Menu.prototype.createCommandWindow;
    Scene_Menu.prototype.createCommandWindow = function(){
        commandAlias.call(this);
        this._commandWindow.setHandler('symbol',      this.myCommand.bind(this));
    };

    Window_MenuCommand.prototype.addMyCommand = function(){
        this.addCommand('MyCommandLabel', 'symbol', true);
    };

    var mAlias = Window_MenuCommand.prototype.makeCommandList;
    Window_MenuCommand.prototype.makeCommandList = function() {
        mAlias.call(this);
        this.addMyCommand();
    };

})();
YES it's working thank you !

Just one thing than I don't get it.
Scene_Menu.prototype.myCommand = function(){
//Your stuff what will it do:
}


Every thing in this, it's for exemple where the menu gonna send the players ?
Scene_Menu.prototype.myCommand = function(){
//Your stuff what will it do:
}

it's a core of the entire menu item, meaning this function will be executed when you press enter on an added command. So you must think of what this function must do and put code there.
you can link it to a variable, common event etc.
if you add a common event ( $gameTemp.reserveCommonEvent(x); )
(x being a the ID), if I have it correctly, that common event will run.
you can set the entire event there what to do, or place everything
inside that command to run.

there are possibilities what it can do.
you can link it to a variable, common event etc.
if you add a common event ( $gameTemp.reserveCommonEvent(x); )
(x being a the ID), if I have it correctly, that common event will run.
you can set the entire event there what to do, or place everything
inside that command to run.

there are possibilities what it can do.
ok I see thank you
I have a similar question. I recently purchased a Custom Command Plugin but can't get it to work.
https://casper-gaming.itch.io/cgmz-menu-command-window

I need the JS Command to open up the battle item menu via the Party Command rather than the actor command. My goal is to move the command button all together from the Actor Menu to the Party menu in battle. But I can't seem to get it to work right. Can anyone help me?

Original thread: https://forums.rpgmakerweb.com/threads/add-a-command-on-the-menu.148757/