SkriptLang / Skript

Skript is a Spigot plugin which allows server admins to customize their server easily, but without the hassle of programming a plugin or asking/paying someone to program a plugin for them.
https://docs.skriptlang.org
GNU General Public License v3.0
1.06k stars 368 forks source link

Cannot teleport an entity that has passengers. #6119

Open NiaSwift opened 11 months ago

NiaSwift commented 11 months ago

Skript/Server Version

[17:39:03 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[17:39:03 INFO]: [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[17:39:03 INFO]: [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[17:39:03 INFO]: [Skript] Server Version: git-Paper-196 (MC: 1.20.1)
[17:39:03 INFO]: [Skript] Skript Version: 2.7.1 (skriptlang-github)
[17:39:03 INFO]: [Skript] Installed Skript Addons: None
[17:39:03 INFO]: [Skript] Installed dependencies: None

Bug Description

If you try to teleport an entity that has another entity riding it using Skript, it will not work. It doesn't give any errors, nor does it give any console errors. It just does not teleport them.

Expected Behavior

It should teleport them both to the desired location (and not dismount them or anything like that). It is possible using Java plugins and even with just vanilla Minecraft commands, but for some reason it isn't with Skript.

Steps to Reproduce

# this is my novel. please keep your arms and legs tucked in at all times. no usage of cellphones during the presentation. enjoy the show.
command /ridetest:
    trigger:
        set {_loc} to player's location
# spawn chicken
        spawn chicken at {_loc} ~ vector(2, 0, 0):
            set {_chicken} to entity
            set name of {_chicken} to "best friend 1"
            set ai of {_chicken} to false
# spawn cave spider
        spawn cave spider at {_loc} ~ vector(-2, 0, 0):
            set {_caveSpider} to entity
            set name of {_caveSpider} to "best friend 2"
            set ai of {_caveSpider} to false
# best friends!!!
        wait 2 seconds
        make {_caveSpider} ride {_chicken}
# difficulty in the bestfriendship
        wait 2 seconds
        teleport {_chicken} to {_loc}
        send "&cno work! (cave spider is too fat)"
# solution: murder
        wait 2 seconds
        kill {_caveSpider}
        wait 2 seconds
        teleport {_chicken} to {_loc}
        send "&aworks!! :)"
        wait 2 seconds
        kill {_chicken}

Errors or Screenshots

Here's a video example of the bug

Other

this took me like 2 hours to make (i have way too much free time on my hands)

guys we're so close to reaching 8 billion sobscrobers! smash like and sobscrobe so i can take over the entire skript github!!1!

(jokes aside, this is an actual bug report. please fix this kthxbye)

Agreement

sovdeeth commented 11 months ago

I believe this is only supported by Paper's experimental teleport API, and since it's still experimental it isn't suitable to add just yet. Please correct me (with javadocs!) if I'm incorrect, though.

I'm sure you can just dismount the passenger and teleport both, then remount them. My bet is most existing implementations do this.

Fusezion commented 11 months ago

Link to the java docs https://jd.papermc.io/paper/1.20/io/papermc/paper/entity/TeleportFlag.html And as Svooodle said it's a paper exclusive, this has been an experimental api since 1.19 and honestly isn't super great as they just do the exact same we as users do in their own way. Just more convenient

Paper for entity ones will grab vehicles/passengers and teleport as a collective then re-mount, at least that's how I view it being done when I saw it used in a discord voice channel.