Clearing Essentials userdata

Discussion in 'Plugin Development' started by KeybladePaladin, Sep 12, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    KeybladePaladin

    I'm making a plugin to essentially wipe a player from a server.

    I have all the bases covered accept Essentials.
    My code:
    Code:
    @EventHandler
        public void Essentials(EntityDeathEvent e) {
          if(e.getEntity() instanceof Player) {
            Player p = (Player) e.getEntity();
            UUID u = p.getUniqueId();
            ess.getUser(u).reset();
           
            p.kickPlayer(ChatColor.translateAlternateColorCodes('&', getConfig().getString("Message.KickMessage")));
            Bukkit.getServer().getPluginManager().getPlugin("Essentials").getPluginLoader().disablePlugin(ess);
           
            File ess3 = new File("plugins/Essentials/userdata");
            File ess3f = new File(ess3, p.getUniqueId() + ".yml");
            ess3f.delete();
           
            Bukkit.getServer().getPluginManager().getPlugin("Essentials").getPluginLoader().enablePlugin(ess);
          }
          }
    That's the most recent way I attempted it.
    I also tried to delete the users data file, but Essentials has sort of like a file recovery thing that stops me.

    Halp!
     
  2. Offline

    boomboompower

    Why do you need to remove a player from the server?
    Regardless, there is a default bukkit file that called"Usercache", this stores if a player has been on the server before.
     
  3. Offline

    KeybladePaladin

    @boomboompower
    I'm making a plugin for a Hardcore Factions server, it checks when you die and then removes you from the server.
    I already have a section for Usercache, but Essentials has its own files that I cant remove.

    More specifically, homes.
     
  4. Offline

    boomboompower

    You would need to get the players UUID that essentials uses.
     
  5. Offline

    Oxyorum

    @KeybladePaladin I believe you'll have to find Essentials plugin folder, then navigate to the player's file and manually delete it.

    Edit 1: Didn't see you already tried that.
    Edit 2: Why are you disabling Essentials before you delete the file?
    Edit 3: Essentials seems to have a command that does exactly what you need: ./ess cleanup
    You want to make sure it deletes the files of only banned players, so have a look at the syntax.
     
    Last edited: Sep 13, 2015
Thread Status:
Not open for further replies.

Share This Page