MZ Autorun in plugin

Hello, I have an idea for a plugin, but I need to take control away from the player, which currently I only know how to do using a common event set to autorun, but I don't want the users of my plugin to have to set up a common event for this, so I thought that I'd just require them to give a common event id in the plugin parameters and then I would programmatically replace that common event's action list with a script call to one of my plugin functions, and then set the common event to be autorun, but this seems like a really dodgy way to go about this, is there any other way for me to do this without it seeming like a hack, or is this an okay way of doing things?
this is a rather bad way to go
a plugin can directly disable control, no need to go through the game interpreter

however there are several ways to do this, and you need to tell us what that plugin is supposed to do before anyone can tell you which way is the best one.
Through event commands you can stop the player from moving. (not from opening up menus though)
this is a rather bad way to go
a plugin can directly disable control, no need to go through the game interpreter

however there are several ways to do this, and you need to tell us what that plugin is supposed to do before anyone can tell you which way is the best one.
I'm making a fishing system, so players shouldn't be able to move or open menus, however the interact button still needs to work in order to use the fishing minigame
then the best way would be to make it as a screen/scene, same as for example the battlescene.

everything on the map stops if the player is in a different scene, but you can still use the controls by linking them directly.
then the best way would be to make it as a screen/scene, same as for example the battlescene.

everything on the map stops if the player is in a different scene, but you can still use the controls by linking them directly.
I tried making a scene once, but it was too complicated, I've only made 1 plugin so far so if it can't be done any other way without stopping menu access, then I'm fine with just stopping movement.
Note that you can use event commands to do custom input handling, e.g.
Note that you can use event commands to do custom input handling, e.g.
as far as i know i can't use event commands while scripting a plugin
as far as i know i can't use event commands while scripting a plugin
You can
how do I do it?
how do I do it?
Which command do you wish to use?
Which command do you wish to use?
I don't know, the whole point of this post is that I don't know how to stop movement control while making a plugin without using a scene because I don't understand how scenes work yet.
I don't know how to stop movement control while making a plugin
Look at the Game_Player object.
JavaScript:
Game_Player.prototype.canMove = function() {
    if ($gameMap.isEventRunning() || $gameMessage.isBusy()) {
        return false;
    }
    if (this.isMoveRouteForcing() || this.areFollowersGathering()) {
        return false;
    }
    if (this._vehicleGettingOn || this._vehicleGettingOff) {
        return false;
    }
    if (this.isInVehicle() && !this.vehicle().canMove()) {
        return false;
    }
    return true;
};
These are the condition to stop the movement by input.
Add your code here. For example.

JavaScript:
Game_Player.prototype.canMove = function() {
    if ($gameSwitches.value(1)) {
        return false;
    }
    if ($gameMap.isEventRunning() || $gameMessage.isBusy()) {
        return false;
    }
    if (this.isMoveRouteForcing() || this.areFollowersGathering()) {
        return false;
    }
    if (this._vehicleGettingOn || this._vehicleGettingOff) {
        return false;
    }
    if (this.isInVehicle() && !this.vehicle().canMove()) {
        return false;
    }
    return true;
};

And here is the code that handles the enable/disable the menu access
JavaScript:
Scene_Map.prototype.isMenuEnabled = function() {
    return $gameSystem.isMenuEnabled() && !$gameMap.isEventRunning();
};

Does this answer your question?
Does this answer your question?
yes it does, thank you so much! This is a great help!

Original thread: https://forums.rpgmakerweb.com/threads/autorun-in-plugin.146621/