How do I make an event hop, taking into account wall tiles?

Hi, all. I have an event with a rabbit sprite,
1750290129781.png

And I want it to hop in random directions. However, with the jump command, it ignores whether the target tile is passable or not. Is there a way to maintain that jump animation in movements, while taking impassable tiles into account?
Easiest thing to do would probably be to make the event itself taller, and make the "hop" as part of the step animation? That would allow it to move up like a hop while maintaining collision
Hmmm, I think you put in the movement route like a script (you might need to also check map bounds or limit the area with regions and also if you want add checks so it doesn't land on game player):

let jumpX = Math.randomInt(4)+1; let jumpY = Math.randomInt(4)+1; if (Math.randomInt(2)){jumpX=-jumpX}; if (Math.randomInt(2)){jumpY=-jumpY}; let targetX = this.x+jumpX; let targetY = this.y+jumpY; if ($gameMap.eventIdXy(targetX, targetY) === 0 && (this.canPass(targetX, targetY, 2)||this.canPass(targetX, targetY, 4)||this.canPass(targetX, targetY, 6)||this.canPass(targetX, targetY, 8))){this.jump(jumpX, jumpY)};

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-make-an-event-hop-taking-into-account-wall-tiles.178406/