Hey guys, I was curious of how I can check if a player is brand new. I don't want to store in a file somewhere that list ALL the players that have joined or anything. Is there a better way of doing this? If so, please let me know, thanks
How does this look guys? Or is this bad to teleport a player on join? Code (Text): @EventHandler public void onJoin(PlayerJoinEvent e) { if (!e.getPlayer().hasPlayedBefore()) { Location l = new Location(Bukkit.getWorld("world"), getConfig().getDouble("Spawn.x"), getConfig().getDouble("Spawn.y"), getConfig().getDouble("Spawn.z"), getConfig().getLong("Spawn.yaw"), getConfig().getLong("Spawn.pitch")); e.getPlayer().teleport(l); } }
You could add in a scheduled teleport. Sometimes the PlayerJoinEvent is executed, even if the player isn't completely on the server and this may cause errors Sorry for my bad english ~ CBPlugins