Is there a way I can create a custom anvil inventory with its title changed? I tired: Code (Text): Inventory inv = this.getServer().createInventory(p, InventoryType.ANVIL, "Enter Name"); But the name does not change.
I am unsure of this but I imagine not. If you're trying to track the inventory, though, getTitle() still returns the title you set so although the player can't see your title, you can detect the inventory with it.
I think you search something like this: http://bukkit.org/threads/how-can-i-open-an-anvil-window.131493/#post-1566510
With that I get: Packet100OpenWindow cannot be resolved to a type And: The constructor ContainerAnvil(PlayerInventory, World, int, int, int, EntityHuman) is undefined
Also I can not set the items in the inventory. I tried: Code (Text): player.getOpenInventory().setItem(0, st); container.getBukkitView().setItem(0, st); Inventory inv = container.getBukkitView().getTopInventory(); inv.setItem(0, st); player.getOpenInventory().getTopInventory().setItem(0, st); But none work.
I'm using Spigot 1.8.8 and I always get the following error: Spoiler: Stacktrace java.util.concurrent.ExecutionException: java.lang.IndexOutOfBoundsException: In dex: 14, Size: 0 at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_60] at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_60] at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:45) [craftbukki t-1.8.8.jar:git-Bukkit-9cd1111] at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:6 72) [craftbukkit-1.8.8.jar:git-Bukkit-9cd1111] at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:3 35) [craftbukkit-1.8.8.jar:git-Bukkit-9cd1111] at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:6 28) [craftbukkit-1.8.8.jar:git-Bukkit-9cd1111] at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java :536) [craftbukkit-1.8.8.jar:git-Bukkit-9cd1111] at java.lang.Thread.run(Unknown Source) [?:1.8.0_60] Caused by: java.lang.IndexOutOfBoundsException: Index: 14, Size: 0 at java.util.ArrayList.rangeCheck(Unknown Source) ~[?:1.8.0_60] at java.util.ArrayList.get(Unknown Source) ~[?:1.8.0_60] at net.minecraft.server.v1_8_R3.Container.clickItem(Container.java:266) ~[craftbukkit-1.8.8.jar:git-Bukkit-9cd1111] at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java :1569) ~[craftbukkit-1.8.8.jar:git-Bukkit-9cd1111] at net.minecraft.server.v1_8_R3.PacketPlayInWindowClick.a(SourceFile:31) ~[craftbukkit-1.8.8.jar:git-Bukkit-9cd1111] at net.minecraft.server.v1_8_R3.PacketPlayInWindowClick.a(SourceFile:9) ~[craftbukkit-1.8.8.jar:git-Bukkit-9cd1111] at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:1 3) ~[craftbukkit-1.8.8.jar:git-Bukkit-9cd1111] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~ [?:1.8.0_60] at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_60] at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) ~[craftbukk it-1.8.8.jar:git-Bukkit-9cd1111] ... 5 more I've tried 3 different versions of the code, with both spigot and craftbukkit latest version, and it all produces the same result. Is it outdated? What can I do to fix it?