How can I teleport a boat that is occupied by a player?

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

mikemc4

Member
Feb 23, 2025
4
0
1
Hello, I have been trying for some time now to try and teleport a boat upwards when it reaches blue ice so I can make it climb blocks for ice boat racing. However, I cannot teleport the boat when the player is inside of it, even when using passenger teleport flags. It teleports the boat upwards correctly when no player is occupying the boat (Mobs also work)


Code:
command /test:
    trigger:
        teleport nearest boat 6 meter above nearest boat retaining vehicle, passengers, and xyz velocity
 
Hello, I have been trying for some time now to try and teleport a boat upwards when it reaches blue ice so I can make it climb blocks for ice boat racing. However, I cannot teleport the boat when the player is inside of it, even when using passenger teleport flags. It teleports the boat upwards correctly when no player is occupying the boat (Mobs also work)


Code:
command /test:
    trigger:
        teleport nearest boat 6 meter above nearest boat retaining vehicle, passengers, and xyz velocity
Python:
command /test:
    trigger:
        if vehicle of player is a boat:
            set {_loc} to location of vehicle of player
            add 5 to y-coord of {_loc}

            teleport vehicle of player to {_loc}

Not tested.
 
Alternative:

Python:
command /test:
    trigger:
        if vehicle of player is a boat:
            set {_i} to 10
            
            while {_i} > 0:

                set velocity of vehicle of player to vector(0,1.5,0) # change 1.5 to change it's speed.

                remove 1 from {_i}
                wait a second


Not tested.
 
The first method does not teleport the boat at all. The second method repeatedly pushes the boat upwards very high in the air, it does not teleport.
 
Python:
command /temp:
        trigger:
        if "%vehicle of player%" contains "boat":
            set {_loc} to location of vehicle of player
            add 5 to y-coord of {_loc}
            
            while distance between {_loc} and location of vehicle of player > 1:
                set {_v} to vector between location of vehicle of player and {_loc}
                set velocity of vehicle of player to {_v}
                wait a tick

            set velocity of vehicle of player to vector(0,0,0)

You can change 5 to anything.

This code will use velocity to move your boat. (I couldn't find the boat teleportation either.).
 
Python:
command /temp:
        trigger:
        if "%vehicle of player%" contains "boat":
            set {_loc} to location of vehicle of player
            add 5 to y-coord of {_loc}
           
            while distance between {_loc} and location of vehicle of player > 1:
                set {_v} to vector between location of vehicle of player and {_loc}
                set velocity of vehicle of player to {_v}
                wait a tick

            set velocity of vehicle of player to vector(0,0,0)

You can change 5 to anything.

This code will use velocity to move your boat. (I couldn't find the boat teleportation either.).
This sort of works but it doesn't work for what I am trying to do because you cannot do this while the boat is moving.