CommandHelper

CommandHelper

46.5k Downloads

bugs in the player_teleport event

LadyCailinBot opened this issue ยท 2 comments

commented

CMDHELPER-2797 - Reported by Hekta

The 'to' prefilter does not seem to work in the player_teleport event.

If I have:

    console('OK')
)bind('player_teleport', null, array('to': array(100, 101, 100, 'world')), @event,
    console('OK')
)
bind('player_teleport', null, array('to': array('x': 100, 'y': 100, 'z': 100, 'world': 'world')), @event,
    console('OK')
)
bind('player_teleport', null, array('to': array('x': 100, 'y': 101, 'z': 100, 'world': 'world')), @event,
    console('OK')
)```
and execute:
```set_ploc('Hekta', array(100, 100, 100, 'world'))```
nothing happens.


Also if a player is teleported to 100, 100, 100, @event['to']['y'] will return 101.


I think the 'from' prefilter is also affected by these problems.


In the wiki, the documentation of the event seems a little broken (it seems that there is a shift in the columns.)
commented

Comment by jb_aero

"Also if a player is teleported to 100, 100, 100, @event['to']['y'] will return 101."
That's because the event returns where the entity (player) actually teleports to as far as the server is concerned, where as the Y value used by ploc and set_ploc is the block they're standing on, so that part is technically a feature.

commented

Comment by LadyCailin

The "to" part was mixed in to use some of the "from" bit. Anyways, this will be fixed in the next build. Thanks!