#Cant teleport a player on first join

1 messages · Page 1 of 1 (latest)

worthy coyote
#

So basically I can't teleport a player to a location on first join, although it still gives them their resistance.

lean echo
#

give it a delay and see if that fixes it

olive mountain
#

^ delay with one tick and see if that helps

worthy coyote
#

I do have a delay

paper dagger
#

how are you delaying?

worthy coyote
#
                public void run() {
                    event.getPlayer().teleport(new Location(getServer().getWorld("world"), x, 255, z));
                } 
            }, 10);```
paper dagger
#

ok, you can't do that.

#

the event will not exist when your task runs

worthy coyote
#

bollocks arlr

#

How do I reposition the delay

paper dagger
#

pass the player to the event.

#

make a final variable for teh task to access

worthy coyote
#

ah okay

#

Where should I create the variable as I already have the 2 args in the DelayedTask

olive mountain
#

You create a variable outside that