Solved ERROR with NBT Codes (NBTBase?)

Discussion in 'Plugin Development' started by mine2012craft, Nov 27, 2016.

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


    Hello Fellow Coders,

    So I have been working on my plugin for a long time (4 months is probably not a long time) and now all of a sudden, this error pops up:

    [12:11:49] [Server thread/INFO]: [MyPlugin] Enabling HiddenPluginNameLol v1.1
    [12:11:49] [Server thread/INFO]: [MyPlugin] >>A config.yml has been detected! Loading config.yml...<<
    [12:11:49] [Server thread/ERROR]: Error occurred while enabling HiddenPluginNameLol v1.1 (Is it up to date?)
    java.lang.NoClassDefFoundError: net/minecraft/server/v1_11_R1/NBTBase
        at testPackage.Core.onEnable( ~[?:?]
        at ~[spigot.jar:git-Spigot-c3e4052-1953f52]
        at [spigot.jar:git-Spigot-c3e4052-1953f52]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin( [spigot.jar:git-Spigot-c3e4052-1953f52]
        at org.bukkit.craftbukkit.v1_10_R1.CraftServer.loadPlugin( [spigot.jar:git-Spigot-c3e4052-1953f52]
        at org.bukkit.craftbukkit.v1_10_R1.CraftServer.enablePlugins( [spigot.jar:git-Spigot-c3e4052-1953f52]
        at net.minecraft.server.v1_10_R1.MinecraftServer.t( [spigot.jar:git-Spigot-c3e4052-1953f52]
        at net.minecraft.server.v1_10_R1.MinecraftServer.l( [spigot.jar:git-Spigot-c3e4052-1953f52]
        at net.minecraft.server.v1_10_R1.MinecraftServer.a( [spigot.jar:git-Spigot-c3e4052-1953f52]
        at net.minecraft.server.v1_10_R1.DedicatedServer.init( [spigot.jar:git-Spigot-c3e4052-1953f52]
        at [spigot.jar:git-Spigot-c3e4052-1953f52]
        at Source) [?:1.8.0_101]
    Caused by: java.lang.ClassNotFoundException: net.minecraft.server.v1_11_R1.NBTBase
        at ~[spigot.jar:git-Spigot-c3e4052-1953f52]
        at ~[spigot.jar:git-Spigot-c3e4052-1953f52]
        at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_101]
        at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_101]
        ... 12 more
    [12:11:49] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it
    [12:11:50] [Server thread/INFO]: Done (20.464s)! For help, type "help" or "?"
    Now this has never happened before in the time I've worked on this. This is the first time I am seeing this error.

    After putting in some debugging lines I realized that it stops at the "4 1/4" line here:

    public void onEnable(){       
            try {
                if (!getDataFolder().exists()) {
                File file = new File(getDataFolder(), "config.yml");
                if (!file.exists()) {
                    getLogger().info(">>A config.yml has not been detected! Writing up a new config.yml...<<");
                } else {
                    getLogger().info(">>A config.yml has been detected! Loading config.yml...<<");
            } catch (Exception e) {
            message = getConfig().getString("message");
            instance = this; 
            //Command Executors
            getCommand("knight").setExecutor(new KitNormal());
            Bukkit.broadcastMessage("4 1/4"); //Here is where the last debug line is printed out
            getCommand("hunter").setExecutor(new KitArcher()); // Possible Culprit
            Bukkit.broadcastMessage("4 1/2"); //This is the line that is not played at all
            getCommand("soup").setExecutor(new ReplenishSoup());
            getCommand("menu").setExecutor(new OpenKitMenu());
            getCommand("upgrade").setExecutor(new OpenUpgradeMenu());
            getCommand("upgrades").setExecutor(new OpenUpgradeMenu());
            getCommand("spell").setExecutor(new OpenSpellMenu());
            getCommand("spells").setExecutor(new OpenSpellMenu());
            getCommand("assassin").setExecutor(new KitAssassin());
            getCommand("mage").setExecutor(new KitMage());
            getCommand("elytrawars").setExecutor(new KitElytraWars());
    In the line that saids "Possible Culprit" the class that is executed does have NBT codes in it for customizing attack damage and speeed for an Axe.

    Now keep in mind that I have recently updated it to 1.11 so I had to change these lines:

    import net.minecraft.server.v1_10_R1.NBTTagCompound;
    import net.minecraft.server.v1_10_R1.NBTTagDouble;
    import net.minecraft.server.v1_10_R1.NBTTagInt;
    import net.minecraft.server.v1_10_R1.NBTTagList;
    import net.minecraft.server.v1_10_R1.NBTTagString;
    to these:

    import net.minecraft.server.v1_11_R1.NBTTagCompound;
    import net.minecraft.server.v1_11_R1.NBTTagDouble;
    import net.minecraft.server.v1_11_R1.NBTTagInt;
    import net.minecraft.server.v1_11_R1.NBTTagList;
    import net.minecraft.server.v1_11_R1.NBTTagString;
    Now obviously this has something to do with not having a NBTBase (Yes I even tried to add that too) but I do not know what it means.

    If anyone has any ideas on what this is causing, please respond. If you need the class that has the NBT codes I will post them without hesitation.

    Thank you,
  2. Offline


    The reason you are getting these errors are because you are not on 1.11!
    Notice how all these lines (from the error) have "1_10" written on them? These lines are saying there was an error At these sections, so these are the ones that do exist.

    To fix this problem: Use the same bukkit version as your server. If you're using a 1.10 server, make sure your plugins support 1.10. If on 1.11, do the same for 1.11
  3. Offline


    Wow uh... I feel stupid... I used 1.10 to load up a map to play with a friend heh... uh...

    *Slowly walks away* [Thanks :)]
  4. Offline

    bwfcwalshy Retired Staff

    @mine2012craft Also note you can make this version independent, you can make this work on multiple versions without having to recompile every time. As long as methods stay the same your code will work.
Thread Status:
Not open for further replies.

Share This Page