Remove playerdata file on death

Discussion in 'Spigot Help' started by TheRaulXP, Apr 16, 2017.

Thread Status:
Not open for further replies.
  1. Hi, i'm currently running a Hardcore server and i want that when a player dies, his playerdata file (the one named uuid.dat) gets deleted. The code that i've been trying is that one:

    Code (Text):
      @EventHandler
      public void onDeath(PlayerDeathEvent event)
      {
        File BaseFolder = new File(Bukkit.getServer().getWorld("world").getWorldFolder(), "playerdata");
        Player player = event.getEntity().getPlayer();
        File playerData = new File(BaseFolder, player.getUniqueId()+".dat");
                playerData.delete();
      }
    But it doesnt seem to work with UUID (it worked with player.getName() in prior versions), could you suggest me what to do?
     
Thread Status:
Not open for further replies.