#JoinEvent Issues
1 messages · Page 1 of 1 (latest)
This is the simple event I made, works on my end 1.18.1 test server
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
Hi
1sec
let me remember
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
Yes i do it
World world = plugin.getServer().getWorld(configWorldNameString)
but still I only have one world
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
minas
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
Ok I'm going to try it as soon as I can
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
Don't worry is ok
Hey yeah if that plug-in doesn’t work idk what will
If it doesn't work I'll make it work lol
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
yeah anyway i'm pretty exhausted now i don't think i can stay up for long
Alright have a good night
Tysm
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);
}
}
the bug continues
💀
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
Should do get float btw not string
Where
A
Because i save it as x: "930.300"
why do you save server.spawn.x as double, call it as string and parse it as double?
Because im dumb
yea i need more info than that
when someone first enters the server, they are teleported to natural spawn
And i don't want it
i sure theres a player.hasplayedbefore
did you try that?
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
did you try checking if the server itself is trying to teleport them somewhere?
sometimes the server properties have a default location
otherwise this could be "fixed" with a delayed tp
wait 2 ticks and teleport
That's what I said
😭
Yes that was going to try it but I thought maybe there was another solution
check google someone might have had the same problem, otherwise i cant think of anything else
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
Their running pur pur, I think that might be the issue cuz it works perfectly fine on my spigot test server
Unless there’s another plug-in
Maybe try installing purpur?
I'm using purpur because it's optimized 😿
Nope
Can't reproduce on my purpur
mmmm
@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
okay 1 sec
with my plugin too?
yes please, I wont use them but it will help to test if any of those are causing the issue
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
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.
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
Do you need to archive the thread right?