Help With Random Encounters in Vehicles

Hello, I'm very new to Javascript, I have some understanding of scripting having studied and used C#. I'm trying to get encounters to work only when i'm in a vehicle. Basically i'm making a pirate game and I only want encounters to happen when my party is on the ship sailing somewhere. Can anyone help me create a plugin or offer me some insight on how I would access this... I assume its something like $gameplayer.isinvehicle?

Also I'm Using RPG maker MV
Never mind, I've set random encounter regions to exclude land. Much much easier than what I was trying to do!
~Giggity

Original thread: https://forums.rpgmakerweb.com/threads/help-with-random-encounters-in-vehicles.103432/