Solved Plugin has randomly stopped working with LibsDisguise.

Discussion in 'Spigot Plugin Development' started by ServerProxy, Apr 19, 2017.

  1. So I am using LibDisguises to make a plugin for a server. Here is my code:
    Code (Text):
    package me.diyar.gmodgun;

    import java.util.ArrayList;
    import java.util.List;

    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.Material;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    import org.bukkit.inventory.ItemStack;
    import org.bukkit.inventory.meta.ItemMeta;

    import me.libraryaddict.disguise.DisguiseAPI;
    import me.libraryaddict.disguise.disguisetypes.PlayerDisguise;

    public class GModGun extends JavaPlugin {
        public void onEnable() {
            getLogger().info("[1.8] Plugin made by Diyar! Make sure you have LibsDisguise!");
        public void onDisable() {  
        public boolean onCommand(CommandSender sender, Command cmd, String label, String args[]) {
            if (cmd.getName().equalsIgnoreCase("gmod")) {
            if    (!(sender instanceof Player))
                sender.sendMessage(ChatColor.GRAY + "You must be a player!");
            if    (!(sender.hasPermission("gmod.toggle")));
            }else if (args.length == 0) {
                Player p = (Player) sender;
                sender.sendMessage(ChatColor.translateAlternateColorCodes('&', getConfig().getString("GMod-Mode")));
                ItemStack Gun = new ItemStack(Material.WOOD_HOE);
                ItemMeta meta = Gun.getItemMeta();
                List<String> lore = new ArrayList <String>();
                lore.add("The almighty gun of Garry's mod!");
                meta.setDisplayName(ChatColor.GRAY + ChatColor.BOLD.toString() + "PhysGun!");
                PlayerDisguise pd = new PlayerDisguise("forgottenclaw");
                DisguiseAPI.disguiseEntity(p.getPlayer(), pd);
            }else if (args.length > 1) {
                sender.sendMessage("You can not give another player this gun!");
            return true;

    Code (Text):
    # Do not edit these hashtags or the config will crash!
    # You can edit these messages!
    # Plugin made by Diyar!
    no-perms: Sorry... You do not have access to this command!
    gmod-mode: You are now in GMod Mode!
    Code (Text):
    main: me.diyar.gmodgun.GModGun
    name: GModGun
    version: 1.0
          description: Use this to get the almighty PhysGun!

    I get red underlined by the PlayerDisguise and DisguiseAPI, it tells me to import and that's what I do but it does not work,
  2. electronicboy

    IRC Staff

    Well, what is the error on the import? Sounds odd, but have you tried restarting your IDE?
  3. It's just underlined red, telling me to import again. I have tried to restart my IDE.
  4. maldahleh

    Wiki Team

    If it's a local jar, did you by chance delete it from your system accidentally or maybe move where the jar is located?
  5. Oh my fucking god! You just saved my life, you beast!