Solved Disguising a Player as a mob API

Discussion in 'Plugin Development' started by Petersoj, Oct 3, 2015.

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

    Petersoj

    Hello, I am trying to use an API for my plugin to disguise a player as a mob. I am using Lib's Disguise to do this. I have looked at the documentation and I have done everything it requires.
    Here is my code:
    Code:
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
    Player p = (Player) sender;
    if (command.getName().equalsIgnoreCase("try")) {
    Entity en = (Entity) sender;
    DisguiseAPI.disguiseToAll(en, new MobDisguise(DisguiseType.CREEPER));
    return true;
    }
    return true;
    }
    
    I have added it to my plugin dependencies in plugin.yml and yes, it is on my server and reference libraries in eclipse.

    Here is the error i get in the server log whenever I start the server:

    Code:
    [21:09:15 ERROR]: Could not load 'plugins/MandatoryAPI.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: me/libraryaddict/disguise/disguisetypes/Disguise
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:135) ~[spigot-1.8.8.jar:git-Spigot-76236cb-d4e32ce]
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:329) ~[spigot-1.8.8.jar:git-Spigot-76236cb-d4e32ce]
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:251) [spigot-1.8.8.jar:git-Spigot-76236cb-d4e32ce]
    at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:292) [spigot-1.8.8.jar:git-Spigot-76236cb-d4e32ce]
    at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:198) [spigot-1.8.8.jar:git-Spigot-76236cb-d4e32ce]
    at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:525) [spigot-1.8.8.jar:git-Spigot-76236cb-d4e32ce]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_40]
    Caused by: java.lang.NoClassDefFoundError: me/libraryaddict/disguise/disguisetypes/Disguise
    at java.lang.Class.forName0(Native Method) ~[?:1.8.0_40]
    at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_40]
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:64) ~[spigot-1.8.8.jar:git-Spigot-76236cb-d4e32ce]
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131) ~[spigot-1.8.8.jar:git-Spigot-76236cb-d4e32ce]
    ... 6 more
    Caused by: java.lang.ClassNotFoundException: me.libraryaddict.disguise.disguisetypes.Disguise
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_40]
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:101) ~[spigot-1.8.8.jar:git-Spigot-76236cb-d4e32ce]
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86) ~[spigot-1.8.8.jar:git-Spigot-76236cb-d4e32ce]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_40]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_40]
    at java.lang.Class.forName0(Native Method) ~[?:1.8.0_40]
    at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_40]
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:64) ~[spigot-1.8.8.jar:git-Spigot-76236cb-d4e32ce]
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131) ~[spigot-1.8.8.jar:git-Spigot-76236cb-d4e32ce]
    ... 6 more
    
    I have tried different plugins and API's and they all sucked. Lib's disguises is by far the best.
    Ive looked everywhere and couldn't find anything to resolve this error. Any help appreciated! Thanks!

    EDIT: although if you have used an API before that works with disguising players as mobs, please let me know.

    If there is a way to do this with packets and not using an api that would be very helpful too
     
    Last edited: Oct 3, 2015
  2. Offline

    Retherz_

    1. Could not load 'plugins/MandatoryAPI.jar' in folder 'plugins'
    2. org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: me/libraryaddict/disguise/disguisetypes/Disguise
     
    dlange likes this.
  3. Offline

    Petersoj

    What? What are you trying to say?
    I have the class in my imports and in my server.
     
  4. Offline

    dlange

    @Petersoj Do you have the plugin on the server?
     
  5. Offline

    Petersoj

    @dlange Yes, read my first post...
     
  6. Offline

    dlange

    @Petersoj But is it functioning in itself? Try using /disguise player Test or something ingame, see if it works.
     
  7. Offline

    Petersoj

    @dlange Yes, it all works by it self. But for some reason when I use the api in my plugin I get those errors and the plugin doesn't load.

    Got it working.... There was a typo in my plugin.yml
    SOLVED

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Oct 30, 2015
Thread Status:
Not open for further replies.

Share This Page