#JoinEvent Issues

1 messages · Page 1 of 1 (latest)

void parrot
#

Also for the world I noticed its a custom named world, how are you getting it?

#

Mine im getting it by the player which isnt the best way to go about it

cerulean knot
#

Hi

void parrot
#

Bukkit.getWorld("world") is the best way to I think

#

but if your main world isn't where your sending the player then there might be an issue teleporting them there as I don't think it gets loaded first but im not sure

cerulean knot
#

World world = plugin.getServer().getWorld(configWorldNameString)

#

but still I only have one world

void parrot
#

then yeah im not 100% sure why it wouldnt work, do you remeber what your world name is?

#

so I can hard code it in

cerulean knot
#

minas

void parrot
#

okay this should teleport the player to

x:7.0 y: 79.0 z: -28.0
on: "minas"
#

if it doesn't idk whats happening, cuz I tested it with a new player and with a player that has played before

cerulean knot
#

Ok I'm going to try it as soon as I can

void parrot
#

Okay cool, this should stay open for as long as it’s needed but idk, if you need me again you can always @ me

#

But I am a little slow sometimes at responding

cerulean knot
#

Don't worry is ok

void parrot
#

Hey yeah if that plug-in doesn’t work idk what will

cerulean knot
#

If it doesn't work I'll make it work lol

void parrot
#

Yeah I had to leave @h computer for a bit but when I get back I’ll send the source code, it’s basically the same as yours

cerulean knot
#

yeah anyway i'm pretty exhausted now i don't think i can stay up for long

void parrot
#

Alright have a good night

cerulean knot
#

Tysm

void parrot
#
public class JoinEvent implements Listener {

    // Check for clicks on items
    @EventHandler
    public void onPlayerJoin(final PlayerJoinEvent e) {
        Location loc = new Location(Bukkit.getWorld("minas"), 7.0, 79.0, -28.0);
        e.getPlayer().teleport(loc);
    }
}
cerulean knot
#
 Player player = (Player) sender;
            if(args[0].equalsIgnoreCase("setspawn") && playeruser.checkPerms(player, "ttn.admin")){
                Location l = player.getLocation();
                double x = l.getX();
                double y = l.getY();
                double z = l.getZ();
                float yaw = l.getYaw();
                float pitch = l.getPitch();
                config.set("server.spawn.x", x);
                config.set("server.spawn.y", y);
                config.set("server.spawn.z", z);
                config.set("server.spawn.yaw", yaw);
                config.set("server.spawn.pitch", pitch);
                config.set("server.spawn.world", player.getWorld().getName());
                main.saveServerConfig();
                playeruser.sendMessage(player, minecraft.SETSPAWN_OK.message);
                return true;
#

the code to save the location

#
if(serverconfig.contains("server.spawn")){
            double x = Double.parseDouble(serverconfig.getString("server.spawn.x"));
            double y = Double.parseDouble(serverconfig.getString("server.spawn.y"));
            double z = Double.parseDouble(serverconfig.getString("server.spawn.z"));
            float yaw = Float.parseFloat(serverconfig.getString("server.spawn.yaw"));
            float pitch = Float.parseFloat(serverconfig.getString("server.spawn.pitch"));
            World world = event.getPlayer().getServer().getWorld(serverconfig.getString("server.spawn.world"));
            Location l = new Location(world, x, y, z, yaw, pitch);
            event.getPlayer().teleport(l);
        }
#

The one to tp he

#

I think i will wait 5seconds and then tp he

void parrot
cerulean knot
#

A

#

Because i save it as x: "930.300"

opal lantern
opal lantern
#

ah

#

and whats the problem?

cerulean knot
#

The first world spawn

#

Lol

opal lantern
#

yea i need more info than that

cerulean knot
#

And i don't want it

opal lantern
#

did you try that?

cerulean knot
#

I mean

#

The code works

#

But

#

The first time they enter the server, it first does the teleport that i want but instantly teleports them to the natural spawn

#

But I don't want them to do the natural tp

opal lantern
#

sometimes the server properties have a default location

#

otherwise this could be "fixed" with a delayed tp

#

wait 2 ticks and teleport

cerulean knot
#

😭

cerulean knot
opal lantern
cerulean knot
#

The problem is the natural spawn of the server

#

I was looking for the server config files and there is nothing like that

#

I also searched for the problem but found nothing about this

void parrot
#

Unless there’s another plug-in

cerulean knot
#

I'm using purpur because it's optimized 😿

mellow plinth
#

Can't reproduce on my purpur

cerulean knot
void parrot
#

@cerulean knot can you send a zipped version of your server here?

#

so I can test on my local machine

#

that way we can have the exact aspects of your server on our end to reproduce the issue

cerulean knot
#

okay 1 sec

void parrot
#

yes please, I wont use them but it will help to test if any of those are causing the issue

cerulean knot
#

the problem is

#

im using one bot with it

#

and virtual database

void parrot
#

you can remove any plugins you think would be confidential, and then if it works fine on my end it would then be one of those plugins

cerulean knot
#

nah dont worry i will just do

#

the server wait 5s and tp

#

I don't want to be delayed anymore by this

#

Thank you @void parrot

#

Thanks for being patient with me too.

void parrot
#

no problem, the next best thing to sending me the files btw would be to remove all plugins but the one your testing

#

and see if it still happens

cerulean knot
#

Okay okay

#

I hope not

#

Thank you

cerulean knot