Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- public void onPlayerJoin(PlayerJoinEvent e)
- {
- Player p = e.getPlayer();
- File playerFile = new File (getDataFolder(), p.getUniqueId().toString() + ".yml");
- FileConfiguration playerConfig = YamlConfiguration.loadConfiguration(playerFile);
- if(!playerFile.exists()) {
- try {
- playerFile.createNewFile();
- playerConfig.createSection("Spiller");
- String path = "Spiller.navn";
- playerConfig.addDefault(path, p.getDisplayName().toString());
- String path2 = "Spiller.navn.bande";
- playerConfig.addDefault(path2, "null");
- } catch (IOException e1) {
- e1.printStackTrace();
- }
- }
- saveConfig();
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement