MZ Help making plugin recognize direction

I'm trying to edit a plugin to recognize what direction characters and events are facing/moving using if/else arguments, but I either get an error saying something like, "this.direction() is not a function" or it doesn't respond to the direction change at all. What can I do?
What are you expecting anyone here to answer? You haven't actually provided any code you've written, the plugin you're trying to implement it, or any other info that would be relevant to tell you where you went wrong.
which plugin? and by scriptcall probably: $gameMap.events(this.event).direction().
maybe you need the events ID if called elsewhere (like console log.)

and you may get the direction 2,4,6,8.

if you want names, it needs to be coded in order to grab those or both.
which plugin? and by scriptcall probably: $gameMap.events(this.event).direction().
maybe you need the events ID if called elsewhere (like console log.)

and you may get the direction 2,4,6,8.

if you want names, it needs to be coded in order to grab those or both.
This plugin:

Specifically this block of code:
if (param.imageOnly) {
const _Sprite_Character_characterPatternY = Sprite_Character.prototype.characterPatternY;
Sprite_Character.prototype.characterPatternY = function() {
const result = _Sprite_Character_characterPatternY.apply(this, arguments);
if (this._character.isHorizontalMove() && this._character.isNeedModifyDirection() && this._prevPatternY) {
return this._prevPatternY;
}
this._prevPatternY = result;
return result;
};
}
})();

I'm trying to get it so that it displays a different character animation when I'm moving up.
"this.direction() is not a function" probably came because you invoked this function on the sprite, but not its character.

this._character.direction() should work.
Still can't quite get it to work, but thanks anyway! This is still useful information.
"this.direction() is not a function" probably came because you invoked this function on the sprite, but not its character.

this._character.direction() should work.

Original thread: https://forums.rpgmakerweb.com/threads/help-making-plugin-recognize-direction.183920/