Skript: Player placed incorrectly in Y axis

Created on 8 Dec 2016  路  20Comments  路  Source: SkriptLang/Skript

Spigot 1.11, Skript dev22f, plus Multiverse-*, PermissionsEx, PerWorldInventory, EssentialsX, ProtocolLib, Vault and a host of other plugins (all latest pulls).

On join or teleport within any world, the player is placed "below grade". If there is a safe location nearby, the player is placed there. Otherwise, the player is placed within a wall or floor. This occurs with /essentials:home, /mv:mvtp, and sometimes with /tp.

If I remove only Skript JAR, the player is placed correctly.

This does not occur with the same scripts in Spigot 1.10.2, Skript 2.1.2.

investigating

All 20 comments

Do you have any scripts that teleport the player? Do you have any addons for Skript?

CORRECTED in bold:

  1. No scripts teleport, but some scripts detect *on teleport*. However, I can generate this behavior with /tp or /mvtp if those scripts are loaded. If Skript is not loaded, teleportation works fine.
  2. No addons.
  3. This behavior does not occur with the same scripts in Spigot 1.10.2 and Skript 2.1.2.

I too am experiencing this issue, except I use EssentialsX, pretty much the same just updated.

Also use EssentialsX, along with the others listed above.

Hmm... Just in case, please try removing your other plugins until you find one that rrmoves the problem. Then post name of that plugin here so I can take look at possible causes of incompatibility.

Environment: Test server with Spigot 1.11 and all plugins removed except Skript-2.2-dev22f. The problem occurs, as described previously, even in the very limited space in my lobby (-4,4-4 to 4,4,4). If I /tp from one corner to the other, I am placed below grade.

Predictably, if I remove Skript (so, no plugins at all), I am placed correctly in the same tests. As described above, with all 60 plugins except Skript, I am placed correctly in the same tests and more extensive tests.

I would be happy to provide access to my test server, if it would be useful to run a debug version of Skript there.

I didn't mean that. I know Skript causes something to not work. However, Skript itself clearly doesn't see any issues since you didn't get error messages. I assume this is caused by some other plugin being incompatible with Skript.

Please find out the name of that plugin, and I will see if that can be fixed.

Lack of a Skript error message does not imply that Skript is not causing the behavior (it may or may not be). but that it doesn't detect or report an error. No other plugin, nor Spigot/MC/CB, reports an error either. It should be clear from the above, since only Spigot/MC/CB and Skript are active, that I have removed other plugins.
I can reproduce the aberrant behavior with only Skript enabled on top of vanilla Spigot/MC/CB, while I can not reproduce the aberrant behavior in vanilla Spigot/MC/CB without Skript. There isn't anywhere else to go. I have no dog in this contest. If you want to visit a debugging platform where the behavior is easily replicated by moving 11 blocks diagonally, I am willing to provide it.

I meant that Skript doesn't see the error as "it doesn't know if something is wrong or not". You're right that we don't really know if Skript is the cause, or just conflicting with some other plugin.

I'll take look at Spigot teleportation implementation for possible causes as soon as possible.

Thank you.

Testing dev22g. Disabled all scripts. No teleport issues. Started enabling scripts. At some point, teleport changed to the failed mode. I will attempt to isolate to specific script(s) and report.

In the interim: Is there code in Skript that can change a Multiverse spawn location (or an Essentials home location)? I would hope not, but when teleport changed to the failed mode, the spawn (and possibly the Essentials home) locations had changed in the Y component, both in-game and in the _Multiverse-Core/worlds.yml_ file! If Skript never touches those files, then perhaps MV is reacting to something that Skript does. I will attempt to isolate and report.

Here is a Skript fragment that is sufficient to cause the incorrect teleportation. When I enable this script, /mvtp or /essentials:home takes me to the target location with Y offset by -1. Interestingly, /mv info displays the incorrect value, although the _Multiverse-Core/worlds.yml_ content is still correct. When I disable the script and /mv reload, teleportation is correct.

The content of the full script, without on teleport:, runs fine as a command.

So, on teleport: seems to be the culprit.

on teleport:
world will be "world_luckyblock"

Waait whaat. That event is more broken than I actually thought.

I've been trying to tell you. :)

I don't actually want to use it, but there is not support for _on enter world_. So I make rather elaborate checks, all designed to see if I just got here from a different world. In any event, _on teleport_ should work correctly.

still an issue, here is the code that triggers it for me (this is not the only code, but the most recent)
````
on teleport:
if player's world is "spawn":
if event-location's world is not "spawn":
clear the player's inventory

This issue gets fixed if you wait a tick

on teleport:
    set {_l} to player's location
    wait a tick
    if {_yourcondition} is true:
        teleport the player to {_l} #"cancel" the event

Edit: Example from Pikachu

Nice possible workaround. Better if it were really fixed.

dev25 fixes this

I agree that dev25 appears to resolve this issue.
@bensku: Was there a specific fix for this issue?

@SlimeDog I believe the issue was that the player location was being retrieved without a .clone(), so when Skript was performing relative block checks upon teleport it was modifying the reference to the player's location directly instead of a clone of their location.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wohahobg picture wohahobg  路  3Comments

Anoniempje1234 picture Anoniempje1234  路  3Comments

Snow-Pyon picture Snow-Pyon  路  4Comments

cyanide43 picture cyanide43  路  4Comments

TrademarkTM picture TrademarkTM  路  4Comments