Solved Trouble opening the inventory

Discussion in 'Spigot Plugin Development' started by Lifeonblack, Jun 1, 2017.

  1. Hello on player right click (PlayerInteractEvent) they will open an inventory for some reason it gives me this error
    Code (Java):
    [16:36:36 ERROR]: Could not pass event PlayerInteractEvent to AuthPin v1.4.3
    org.bukkit.event.EventException
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
    va:306) ~[Spigot.jar:git-Spigot-3fb9445-2b6c9f4]
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
    a:62) ~[Spigot.jar:git-Spigot-3fb9445-2b6c9f4]
            at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.j
    ava:502) [Spigot.jar:git-Spigot-3fb9445-2b6c9f4]
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    ava:487) [Spigot.jar:git-Spigot-3fb9445-2b6c9f4]
            at org.bukkit.craftbukkit.v1_11_R1.event.CraftEventFactory.callPlayerInt
    eractEvent(CraftEventFactory.java:234) [Spigot.jar:git-Spigot-3fb9445-2b6c9f4]
            at org.bukkit.craftbukkit.v1_11_R1.event.CraftEventFactory.callPlayerInt
    eractEvent(CraftEventFactory.java:201) [Spigot.jar:git-Spigot-3fb9445-2b6c9f4]
            at org.bukkit.craftbukkit.v1_11_R1.event.CraftEventFactory.callPlayerInt
    eractEvent(CraftEventFactory.java:197) [Spigot.jar:git-Spigot-3fb9445-2b6c9f4]
            at net.minecraft.server.v1_11_R1.PlayerConnection.a(PlayerConnection.jav
    a:951) [Spigot.jar:git-Spigot-3fb9445-2b6c9f4]
            at net.minecraft.server.v1_11_R1.PacketPlayInBlockPlace.a(PacketPlayInBl
    ockPlace.java:26) [Spigot.jar:git-Spigot-3fb9445-2b6c9f4]
            at net.minecraft.server.v1_11_R1.PacketPlayInBlockPlace.a(PacketPlayInBl
    ockPlace.java:1) [Spigot.jar:git-Spigot-3fb9445-2b6c9f4]
            at net.minecraft.server.v1_11_R1.PlayerConnectionUtils$1.run(SourceFile:
    13) [Spigot.jar:git-Spigot-3fb9445-2b6c9f4]
            at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [
    ?:1.8.0_131]
            at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_131]
            at net.minecraft.server.v1_11_R1.SystemUtils.a(SourceFile:46) [Spigot.ja
    r:git-Spigot-3fb9445-2b6c9f4]
            at net.minecraft.server.v1_11_R1.MinecraftServer.D(MinecraftServer.java:
    747) [Spigot.jar:git-Spigot-3fb9445-2b6c9f4]
            at net.minecraft.server.v1_11_R1.DedicatedServer.D(DedicatedServer.java:
    399) [Spigot.jar:git-Spigot-3fb9445-2b6c9f4]
            at net.minecraft.server.v1_11_R1.MinecraftServer.C(MinecraftServer.java:
    678) [Spigot.jar:git-Spigot-3fb9445-2b6c9f4]
            at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.jav
    a:576) [Spigot.jar:git-Spigot-3fb9445-2b6c9f4]
            at java.lang.Thread.run(Unknown Source) [?:1.8.0_131]
    Caused by: java.lang.ArrayIndexOutOfBoundsException: 9
            at java.util.Arrays$ArrayList.set(Unknown Source) ~[?:1.8.0_131]
            at net.minecraft.server.v1_11_R1.NonNullList.set(SourceFile:47) ~[Spigot
    .jar:git-Spigot-3fb9445-2b6c9f4]
            at org.bukkit.craftbukkit.v1_11_R1.inventory.CraftInventoryCustom$Minecr
    aftInventory.setItem(CraftInventoryCustom.java:107) ~[Spigot.jar:git-Spigot-3fb9
    445-2b6c9f4]
            at org.bukkit.craftbukkit.v1_11_R1.inventory.CraftInventory.setItem(Craf
    tInventory.java:96) ~[Spigot.jar:git-Spigot-3fb9445-2b6c9f4]
            at me.lifeonblack.AuthPin.Utils.Inventories.createInv(Inventories.java:3
    24) ~[?:?]
            at me.lifeonblack.AuthPin.Events.Moving.onInteract(Moving.java:141) ~[?:
    ?]
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0
    _131]
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0
    _131]
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1
    .8.0_131]
            at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_131]
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
    va:302) ~[Spigot.jar:git-Spigot-3fb9445-2b6c9f4]
            ... 18 more
    >
    Code (Java):
    // p define as Plugin
    // it is already onEnable() at main class
    newFile = new File(p.getDataFolder(), "items.yml");
    if(!newFile.exists()) {
                try {
                    file.createNewFile();
                    p.saveResource("items.yml", false);
                }catch(IOException e) {
                    e.printStackTrace();
                }
            }
    Code (Java):
    // loading by this method
    public FileConfiguration getNewConfig() {
            return newConfig;
        }
    the error points out here
    Code (Java):
    for(int i = 0; i < 54; i++) {
                    ItemStack passcodeplace = createItem("placeholder");
                    inv.setItem(i, passcodeplace);
                }
    Code (Java):
    // the two methods
    private static ItemStack createItem(String path) {
            ItemStack item = null;
            if(plugin.getLocation().getNewConfig().getString(path + ".data") == null) {
                item = new ItemStack(Material.getMaterial(plugin.getLocation().getNewConfig().getString(path + ".type").toUpperCase()), 1,
                        (short)plugin.getLocation().getNewConfig().getInt(path + ".data"));
            }
            item = new ItemStack(Material.getMaterial(plugin.getLocation().getNewConfig().getString(path + ".type").toUpperCase()));
            ItemMeta imeta = item.getItemMeta();
            if(plugin.getLocation().getNewConfig().getBoolean(path + ".enchantment")) {
                imeta.addEnchant(Enchantment.DURABILITY, 1, true);
                imeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
            }
            imeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
            imeta.setDisplayName(Util.colorize(path + ".name"));
            if(plugin.getLocation().getNewConfig().contains(path + ".lore")) {
                imeta.setLore(plugin.getLocation().getNewConfig().getStringList(path + ".lore"));
            }
            item.setItemMeta(imeta);
            return item;
        }
        private static Integer position(String path) {
            return (plugin.getLocation().getNewConfig().getInt(path + ".position") - 1);
            }
     
  2. Try debug . Some of your array is out of bound
     
  3. misleading title...
     
  4. how it mislead? the error persist before the inventory opens.
     
  5. the config created successfully, the item successfully created, the position got successfully, and inventory successfully created now I don't know why this error persist.
     
  6. now its more informative :D
     
  7. anyways this is my items.yml sample data
    Code (Java):
    # Items in authpin
    1:
      # material type
      type: 'wool'
      # material data so it could look like material_id:data
      data:
      # Position of item in the inventory 1 - 54
      position: 13
      # Name of the item
      name: '&f&l1'
      # If true item will appear with enchantment
      enchantment: true
     
  8. Your error is actually in Inventories.java line 324, method CreateInv, can you provide that?
     
  9. But still , you should debug your code to see where the error come from .
     
  10. sure the line 324 is creating an itemstack so I'm going to show you from first to end
    Code (Java):
                ItemStack currentpin = new ItemStack(Material.STAINED_GLASS_PANE, 1, (short)4);
                ItemMeta currentm = currentpin.getItemMeta();
                currentm.setDisplayName(Util.colorize(plugin.getConfig().getString("Names.Register")));
                currentm.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
                currentpin.setItemMeta(currentm);
                inv.setItem(2, currentpin);
     
  11. yes that's why I quoted your post I already debugged and that's the result.
     
  12. Could I see where you initialize your object inv, maybe that could be the root of the problem, as of right now I can not find it however your error is an Array that is out of bounds, and its happening in setItem so I could only assume oddly enough the 2 you have is out of bounds, except I dont know why unless I see where you create "inv" from.
     
  13. Could you screen shot your IDE ? I've to check that

    or maybe you didnt create that inventory before setItem in it
     
  14. this is the whole class
    Code (Java):

    package me.lifeonblack.AuthPin.Utils;

    import org.bukkit.Bukkit;
    import org.bukkit.Material;
    import org.bukkit.enchantments.Enchantment;
    import org.bukkit.inventory.Inventory;
    import org.bukkit.inventory.ItemFlag;
    import org.bukkit.inventory.ItemStack;
    import org.bukkit.inventory.meta.ItemMeta;

    import me.lifeonblack.AuthPin.AuthPin;
    import me.lifeonblack.AuthPin.Utils.Util.AuthType;

    public class Inventories {
        private static AuthPin plugin;
        @SuppressWarnings("static-access")
        public Inventories(AuthPin plugin) {
            this.plugin = plugin;
        }
       
       
        private static ItemStack createItem(String path) {
            ItemStack item = null;
            if(plugin.getLocation().getNewConfig().getString(path + ".data") != null) {
                item = new ItemStack(Material.getMaterial(plugin.getLocation().getNewConfig().getString(path + ".type").toUpperCase()), 1,
                        (short)plugin.getLocation().getNewConfig().getInt(path + ".data"));
            }else {
                item = new ItemStack(Material.getMaterial(plugin.getLocation().getNewConfig().getString(path + ".type").toUpperCase()));
            }
            ItemMeta imeta = item.getItemMeta();
            if(plugin.getLocation().getNewConfig().getBoolean(path + ".enchantment")) {
                imeta.addEnchant(Enchantment.DURABILITY, 1, true);
                imeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
            }
            imeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
            imeta.setDisplayName(Util.colorize(path + ".name"));
            if(plugin.getLocation().getNewConfig().contains(path + ".lore")) {
                imeta.setLore(plugin.getLocation().getNewConfig().getStringList(path + ".lore"));
            }
            item.setItemMeta(imeta);
            return item;
        }
       
        public static Inventory createInv(AuthType type) {
            if(type.equals(AuthType.REGISTER)) {
                Inventory inv = Bukkit.getServer().createInventory(null, 54, Util.colorize(plugin.getConfig().getString("Names.Register")));
                for(int i = 0; i < 54; i++) {
                    ItemStack passcodeplace = createItem("placeholder");
                    inv.setItem(i, passcodeplace);
                }
                ItemStack passcode1 = createItem("1");
                inv.setItem((int)position("1"), passcode1);
               
                ItemStack passcode2 = createItem("2");
                inv.setItem((int)position("2"), passcode2);
               
                ItemStack passcode3 = createItem("3");
                inv.setItem((int)position("3"), passcode3);
               
                ItemStack passcode4 = createItem("4");
                inv.setItem((int)position("4"), passcode4);
               
                ItemStack passcode5 = createItem("5");
                inv.setItem((int)position("5"), passcode5);
               
                ItemStack passcode6 = createItem("6");
                inv.setItem((int)position("6"), passcode6);
               
                ItemStack passcode7 = createItem("7");
                inv.setItem((int)position("7"), passcode7);
               
                ItemStack passcode8 = createItem("8");
                inv.setItem((int)position("8"), passcode8);
               
                ItemStack passcode9 = createItem("9");
                inv.setItem((int)position("9"), passcode9);
               
                ItemStack passcodereg = createItem("register");
                inv.setItem((int)position("register"), passcodereg);
               
                ItemStack passcode0 = createItem("0");
                inv.setItem((int)position("0"), passcode0);
                return inv;
            }
           
            if(type.equals(AuthType.LOGIN)) {
                Inventory inv = Bukkit.getServer().createInventory(null, 54, Util.colorize(plugin.getConfig().getString("Names.Login")));
                for(int i = 0; i < 54; i++) {
                    ItemStack passcodeplace = createItem("placeholder");
                    inv.setItem(i, passcodeplace);
                }
                ItemStack passcode1 = createItem("1");
                inv.setItem((int)position("1"), passcode1);
               
                ItemStack passcode2 = createItem("2");
                inv.setItem((int)position("2"), passcode2);
               
                ItemStack passcode3 = createItem("3");
                inv.setItem((int)position("3"), passcode3);
               
                ItemStack passcode4 = createItem("4");
                inv.setItem((int)position("4"), passcode4);
               
                ItemStack passcode5 = createItem("5");
                inv.setItem((int)position("5"), passcode5);
               
                ItemStack passcode6 = createItem("6");
                inv.setItem((int)position("6"), passcode6);
               
                ItemStack passcode7 = createItem("7");
                inv.setItem((int)position("7"), passcode7);
               
                ItemStack passcode8 = createItem("8");
                inv.setItem((int)position("8"), passcode8);
               
                ItemStack passcode9 = createItem("9");
                inv.setItem((int)position("9"), passcode9);
               
                ItemStack passcodelog = createItem("login");
                inv.setItem((int)position("login"), passcodelog);
               
                ItemStack passcode0 = createItem("0");
                inv.setItem((int)position("0"), passcode0);
                return inv;
            }
            if(type.equals(AuthType.CONFIRM)) {
                Inventory inv = Bukkit.getServer().createInventory(null, 54, Util.colorize(plugin.getConfig().getString("Names.Confirm")));
                for(int i = 0; i < 54; i++) {
                    ItemStack passcodeplace = createItem("placeholder");
                    inv.setItem(i, passcodeplace);
                }
                ItemStack passcode1 = createItem("1");
                inv.setItem((int)position("1"), passcode1);
               
                ItemStack passcode2 = createItem("2");
                inv.setItem((int)position("2"), passcode2);
               
                ItemStack passcode3 = createItem("3");
                inv.setItem((int)position("3"), passcode3);
               
                ItemStack passcode4 = createItem("4");
                inv.setItem((int)position("4"), passcode4);
               
                ItemStack passcode5 = createItem("5");
                inv.setItem((int)position("5"), passcode5);
               
                ItemStack passcode6 = createItem("6");
                inv.setItem((int)position("6"), passcode6);
               
                ItemStack passcode7 = createItem("7");
                inv.setItem((int)position("7"), passcode7);
               
                ItemStack passcode8 = createItem("8");
                inv.setItem((int)position("8"), passcode8);
               
                ItemStack passcode9 = createItem("9");
                inv.setItem((int)position("9"), passcode9);
               
                ItemStack passcodeconf = createItem("confirm");
                inv.setItem((int)position("confirm"), passcodeconf);
               
                ItemStack passcode0 = createItem("0");
                inv.setItem((int)position("0"), passcode0);
                return inv;
            }
           
            if(type.equals(AuthType.CONFIRM2)) {
                Inventory inv = Bukkit.getServer().createInventory(null, 54, Util.colorize(plugin.getConfig().getString("Names.ConfirmReg")));
                for(int i = 0; i < 54; i++) {
                    ItemStack passcodeplace = createItem("placeholder");
                    inv.setItem(i, passcodeplace);
                }
                ItemStack passcode1 = createItem("1");
                inv.setItem((int)position("1"), passcode1);
               
                ItemStack passcode2 = createItem("2");
                inv.setItem((int)position("2"), passcode2);
               
                ItemStack passcode3 = createItem("3");
                inv.setItem((int)position("3"), passcode3);
               
                ItemStack passcode4 = createItem("4");
                inv.setItem((int)position("4"), passcode4);
               
                ItemStack passcode5 = createItem("5");
                inv.setItem((int)position("5"), passcode5);
               
                ItemStack passcode6 = createItem("6");
                inv.setItem((int)position("6"), passcode6);
               
                ItemStack passcode7 = createItem("7");
                inv.setItem((int)position("7"), passcode7);
               
                ItemStack passcode8 = createItem("8");
                inv.setItem((int)position("8"), passcode8);
               
                ItemStack passcode9 = createItem("9");
                inv.setItem((int)position("9"), passcode9);
               
                ItemStack passcodeconf = createItem("confirm");
                inv.setItem((int)position("confirm"), passcodeconf);
               
                ItemStack passcode0 = createItem("0");
                inv.setItem((int)position("0"), passcode0);
                return inv;
            }
           
            if(type.equals(AuthType.OLD)) {
                Inventory inv = Bukkit.getServer().createInventory(null, 54, Util.colorize(plugin.getConfig().getString("Names.Changepass_old")));
                for(int i = 0; i < 54; i++) {
                    ItemStack passcodeplace = createItem("placeholder");
                    inv.setItem(i, passcodeplace);
                }
                ItemStack passcode1 = createItem("1");
                inv.setItem((int)position("1"), passcode1);
               
                ItemStack passcode2 = createItem("2");
                inv.setItem((int)position("2"), passcode2);
               
                ItemStack passcode3 = createItem("3");
                inv.setItem((int)position("3"), passcode3);
               
                ItemStack passcode4 = createItem("4");
                inv.setItem((int)position("4"), passcode4);
               
                ItemStack passcode5 = createItem("5");
                inv.setItem((int)position("5"), passcode5);
               
                ItemStack passcode6 = createItem("6");
                inv.setItem((int)position("6"), passcode6);
               
                ItemStack passcode7 = createItem("7");
                inv.setItem((int)position("7"), passcode7);
               
                ItemStack passcode8 = createItem("8");
                inv.setItem((int)position("8"), passcode8);
               
                ItemStack passcode9 = createItem("9");
                inv.setItem((int)position("9"), passcode9);
               
                ItemStack passcodeconf = createItem("confirm");
                inv.setItem((int)position("confirm"), passcodeconf);
               
                ItemStack passcode0 = createItem("0");
                inv.setItem((int)position("0"), passcode0);
                return inv;
            }
           
            if(type.equals(AuthType.NEW)) {
                Inventory inv = Bukkit.getServer().createInventory(null, 54, Util.colorize(plugin.getConfig().getString("Names.Changepass_new")));
                for(int i = 0; i < 54; i++) {
                    ItemStack passcodeplace = createItem("placeholder");
                    inv.setItem(i, passcodeplace);
                }
                ItemStack passcode1 = createItem("1");
                inv.setItem((int)position("1"), passcode1);
               
                ItemStack passcode2 = createItem("2");
                inv.setItem((int)position("2"), passcode2);
               
                ItemStack passcode3 = createItem("3");
                inv.setItem((int)position("3"), passcode3);
               
                ItemStack passcode4 = createItem("4");
                inv.setItem((int)position("4"), passcode4);
               
                ItemStack passcode5 = createItem("5");
                inv.setItem((int)position("5"), passcode5);
               
                ItemStack passcode6 = createItem("6");
                inv.setItem((int)position("6"), passcode6);
               
                ItemStack passcode7 = createItem("7");
                inv.setItem((int)position("7"), passcode7);
               
                ItemStack passcode8 = createItem("8");
                inv.setItem((int)position("8"), passcode8);
               
                ItemStack passcode9 = createItem("9");
                inv.setItem((int)position("9"), passcode9);
               
                ItemStack passcodeconf = createItem("confirm");
                inv.setItem((int)position("confirm"), passcodeconf);
               
                ItemStack passcode0 = createItem("0");
                inv.setItem((int)position("0"), passcode0);
                return inv;
            }
            if(type.equals(AuthType.MAIN_LOGGED)) {
                Inventory inv = Bukkit.getServer().createInventory(null, 9, Util.colorize(plugin.getConfig().getString("Names.Main")));
                for(int i = 0; i < 54; i++) {
                    ItemStack passcodeplace = createItem("placeholder");
                    inv.setItem(i, passcodeplace);
                }
                ItemStack currentpin = new ItemStack(Material.STAINED_GLASS_PANE, 1, (short)4);
                ItemMeta currentm = currentpin.getItemMeta();
                currentm.setDisplayName(Util.colorize(plugin.getConfig().getString("Names.MainPin")));
                currentm.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
                currentpin.setItemMeta(currentm);
                inv.setItem(2, currentpin);
               
                ItemStack change = new ItemStack(Material.STAINED_GLASS_PANE, 1, (short)5);
                ItemMeta changem = change.getItemMeta();
                changem.setDisplayName(Util.colorize(plugin.getConfig().getString("Names.Changepass")));
                changem.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
                change.setItemMeta(changem);
                inv.setItem(5, change);
               
                ItemStack out = new ItemStack(Material.STAINED_GLASS_PANE, 1, (short)6);
                ItemMeta outm = out.getItemMeta();
                outm.setDisplayName(Util.colorize(plugin.getConfig().getString("Names.Logout")));
                outm.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
                out.setItemMeta(outm);
                inv.setItem(6, out);
                return inv;
            }
           
            if(type.equals(AuthType.MAIN_OFF)) {
                Inventory inv = Bukkit.getServer().createInventory(null, 9, Util.colorize(plugin.getConfig().getString("Names.Main")));
                for(int i = 0; i < 54; i++) {
                    ItemStack passcodeplace = createItem("placeholder");
                    inv.setItem(i, passcodeplace);
                }
                ItemStack currentpin = new ItemStack(Material.STAINED_GLASS_PANE, 1, (short)4);
                ItemMeta currentm = currentpin.getItemMeta();
                currentm.setDisplayName(Util.colorize(plugin.getConfig().getString("Names.Register")));
                currentm.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
                currentpin.setItemMeta(currentm);
                inv.setItem(2, currentpin);
               
                ItemStack out = new ItemStack(Material.STAINED_GLASS_PANE, 1, (short)6);
                ItemMeta outm = out.getItemMeta();
                outm.setDisplayName(Util.colorize(plugin.getConfig().getString("Names.Login")));
                outm.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
                out.setItemMeta(outm);
                inv.setItem(6, out);
                return inv;
            }
            return null;
        }
       
        private static Integer position(String path) {
           return (plugin.getLocation().getNewConfig().getInt(path + ".position") - 1);
        }

    }
     
     
  15. Found it
    upload_2017-6-1_16-42-6.png

    You make a 9 slot inventory and loop , set item to slot 53
     
  16. I see your error, it was above the for loop that you posted above.

    You have
    Inventory inv = Bukkit.getServer().createInventory(null, 9, Util.colorize(plugin.getConfig().getString("Names.Main")));

    But your looping through 54 slots, not 9.

    Please learn from your mistake by taking this small lesson on reading a stack heap error:

    Code (Text):

    [16:36:36 ERROR]: Could not pass event PlayerInteractEvent to AuthPin v1.4.3
    org.bukkit.event.EventException
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
    va:306) ~[Spigot.jar:git-Spigot-3fb9445-2b6c9f4]
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
    a:62) ~[Spigot.jar:git-Spigot-3fb9445-2b6c9f4]
            at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.j
    ava:502) [Spigot.jar:git-Spigot-3fb9445-2b6c9f4]
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    ava:487) [Spigot.jar:git-Spigot-3fb9445-2b6c9f4]
            at org.bukkit.craftbukkit.v1_11_R1.event.CraftEventFactory.callPlayerInt
    eractEvent(CraftEventFactory.java:234) [Spigot.jar:git-Spigot-3fb9445-2b6c9f4]
            at org.bukkit.craftbukkit.v1_11_R1.event.CraftEventFactory.callPlayerInt
    eractEvent(CraftEventFactory.java:201) [Spigot.jar:git-Spigot-3fb9445-2b6c9f4]
            at org.bukkit.craftbukkit.v1_11_R1.event.CraftEventFactory.callPlayerInt
    eractEvent(CraftEventFactory.java:197) [Spigot.jar:git-Spigot-3fb9445-2b6c9f4]
            at net.minecraft.server.v1_11_R1.PlayerConnection.a(PlayerConnection.jav
    a:951) [Spigot.jar:git-Spigot-3fb9445-2b6c9f4]
            at net.minecraft.server.v1_11_R1.PacketPlayInBlockPlace.a(PacketPlayInBl
    ockPlace.java:26) [Spigot.jar:git-Spigot-3fb9445-2b6c9f4]
            at net.minecraft.server.v1_11_R1.PacketPlayInBlockPlace.a(PacketPlayInBl
    ockPlace.java:1) [Spigot.jar:git-Spigot-3fb9445-2b6c9f4]
            at net.minecraft.server.v1_11_R1.PlayerConnectionUtils$1.run(SourceFile:
    13) [Spigot.jar:git-Spigot-3fb9445-2b6c9f4]
            at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [
    ?:1.8.0_131]
            at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_131]
            at net.minecraft.server.v1_11_R1.SystemUtils.a(SourceFile:46) [Spigot.ja
    r:git-Spigot-3fb9445-2b6c9f4]
            at net.minecraft.server.v1_11_R1.MinecraftServer.D(MinecraftServer.java:
    747) [Spigot.jar:git-Spigot-3fb9445-2b6c9f4]
            at net.minecraft.server.v1_11_R1.DedicatedServer.D(DedicatedServer.java:
    399) [Spigot.jar:git-Spigot-3fb9445-2b6c9f4]
            at net.minecraft.server.v1_11_R1.MinecraftServer.C(MinecraftServer.java:
    678) [Spigot.jar:git-Spigot-3fb9445-2b6c9f4]
            at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.jav
    a:576) [Spigot.jar:git-Spigot-3fb9445-2b6c9f4]
            at java.lang.Thread.run(Unknown Source) [?:1.8.0_131]
    Caused by: java.lang.ArrayIndexOutOfBoundsException: 9
            at java.util.Arrays$ArrayList.set(Unknown Source) ~[?:1.8.0_131]
            at net.minecraft.server.v1_11_R1.NonNullList.set(SourceFile:47) ~[Spigot
    .jar:git-Spigot-3fb9445-2b6c9f4]
            at org.bukkit.craftbukkit.v1_11_R1.inventory.CraftInventoryCustom$Minecr
    aftInventory.setItem(CraftInventoryCustom.java:107) ~[Spigot.jar:git-Spigot-3fb9
    445-2b6c9f4]
            at org.bukkit.craftbukkit.v1_11_R1.inventory.CraftInventory.setItem(Craf
    tInventory.java:96) ~[Spigot.jar:git-Spigot-3fb9445-2b6c9f4]
            at me.lifeonblack.AuthPin.Utils.Inventories.createInv(Inventories.java:3
    24) ~[?:?]
            at me.lifeonblack.AuthPin.Events.Moving.onInteract(Moving.java:141) ~[?:
    ?]
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0
    _131]
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0
    _131]
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1
    .8.0_131]
            at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_131]
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
    va:302) ~[Spigot.jar:git-Spigot-3fb9445-2b6c9f4]
            ... 18 more
    >
     
    First line tells you the event that couldn't get passed. So you know its some code thats being called within that event, PlayerInteractEven.

    Keep going down and you'll see Caused by: java.lang.ArrayIndexOutOfBoundsException: 9

    This means the error that is breaking everything is an ArrayIndexOutOfBOundsException, and its expecting an index of 9. Thats because your loop is going from 0 to 53 but the inventory you created can only go from 0 to 8, so 9 is missing... all the way to 53.

    Lastly, if you go line by line downward find the breadcrumb that starts looking like your package and you will find the exact method and line causing your problem.
     
  17. wait it caused by copy and paste :(
     
  18. Mark your post as solved