me.libraryaddict.disguise does not exist but implemented with dependencies

Viewed 54

So yeah title says it. I get the error: me.libraryaddict.disguise does not exist but I implemented it in the Dependencies in my Project Structure. I developed this plugin in IntelliJ and here's my code:

import me.libraryaddict.disguise.DisguiseAPI;
import me.libraryaddict.disguise.disguisetypes.DisguiseType;
import me.libraryaddict.disguise.disguisetypes.MobDisguise;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
 
public class mobdisguise implements CommandExecutor {

    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        Player p = (Player) sender;
        Entity en = (Entity) sender;
        DisguiseAPI.disguiseToAll(en, new MobDisguise(DisguiseType.CREEPER));
        return true;
    }

}
1 Answers

If class me.libraryaddict.disguise, is from library and that library is not provided at runtime (the library is not a plugin), then you must compile that library to your artifact.

If you are using maven building system, this can be done by adding it as your dependency and then using shading plugin to put it in the jar.

If you are using purely just IntelliJ's building system, you have to specify dependency scope, so that intelliJ knows that your plugin has to have this library in it's jar. More information on official page.

Related