1.15.2 Need help opening anvil inventory

Discussion in 'Spigot Plugin Development' started by DInoE, Feb 5, 2020.

  1. Hi! I am trying to make a plugin which requires a working anvil inventory, but no actual block. I am currently doing this:
    Code (Java):
    p.openInventory(Bukkit.createInventory(null, InventoryType.ANVIL));
    but i am getting this error in the console whenever a player interacts with the Inventory:
    [09:49:11 FATAL]: Error executing task on Server
    java.lang.UnsupportedOperationException: Not supported yet.
    at net.minecraft.server.v1_15_R1.ContainerAccess.getWorld(ContainerAccess.java:11) ~[spigot-1.15.2.jar:git-Spigot-800b93f-8160e29]
    at net.minecraft.server.v1_15_R1.ContainerAccess.getLocation(ContainerAccess.java:19) ~[spigot-1.15.2.jar:git-Spigot-800b93f-8160e29]
    at net.minecraft.server.v1_15_R1.ContainerAnvil.getBukkitView(ContainerAnvil.java:394) ~[spigot-1.15.2.jar:git-Spigot-800b93f-8160e29]
    at net.minecraft.server.v1_15_R1.ContainerAnvil.e(ContainerAnvil.java:307) ~[spigot-1.15.2.jar:git-Spigot-800b93f-8160e29]
    at net.minecraft.server.v1_15_R1.ContainerAnvil.a(ContainerAnvil.java:123) ~[spigot-1.15.2.jar:git-Spigot-800b93f-8160e29]
    at net.minecraft.server.v1_15_R1.ContainerAnvil$1.update(ContainerAnvil.java:42) ~[spigot-1.15.2.jar:git-Spigot-800b93f-8160e29]
    at net.minecraft.server.v1_15_R1.InventorySubcontainer.setItem(InventorySubcontainer.java:158) ~[spigot-1.15.2.jar:git-Spigot-800b93f-8160e29]
    at net.minecraft.server.v1_15_R1.Slot.set(SourceFile:82) ~[spigot-1.15.2.jar:git-Spigot-800b93f-8160e29]
    at net.minecraft.server.v1_15_R1.Container.a(Container.java:411) ~[spigot-1.15.2.jar:git-Spigot-800b93f-8160e29]
    at net.minecraft.server.v1_15_R1.PlayerConnection.a(PlayerConnection.java:2155) ~[spigot-1.15.2.jar:git-Spigot-800b93f-8160e29]
    at net.minecraft.server.v1_15_R1.PacketPlayInWindowClick.a(SourceFile:32) ~[spigot-1.15.2.jar:git-Spigot-800b93f-8160e29]
    at net.minecraft.server.v1_15_R1.PacketPlayInWindowClick.a(SourceFile:10) ~[spigot-1.15.2.jar:git-Spigot-800b93f-8160e29]
    at net.minecraft.server.v1_15_R1.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:19) ~[spigot-1.15.2.jar:git-Spigot-800b93f-8160e29]
    at net.minecraft.server.v1_15_R1.TickTask.run(SourceFile:18) ~[spigot-1.15.2.jar:git-Spigot-800b93f-8160e29]
    at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.executeTask(SourceFile:144) [spigot-1.15.2.jar:git-Spigot-800b93f-8160e29]
    at net.minecraft.server.v1_15_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) [spigot-1.15.2.jar:git-Spigot-800b93f-8160e29]
    at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.executeNext(SourceFile:118) [spigot-1.15.2.jar:git-Spigot-800b93f-8160e29]
    at net.minecraft.server.v1_15_R1.MinecraftServer.ba(MinecraftServer.java:918) [spigot-1.15.2.jar:git-Spigot-800b93f-8160e29]
    at net.minecraft.server.v1_15_R1.MinecraftServer.executeNext(MinecraftServer.java:911) [spigot-1.15.2.jar:git-Spigot-800b93f-8160e29]
    at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.awaitTasks(SourceFile:127) [spigot-1.15.2.jar:git-Spigot-800b93f-8160e29]
    at net.minecraft.server.v1_15_R1.MinecraftServer.sleepForTick(MinecraftServer.java:895) [spigot-1.15.2.jar:git-Spigot-800b93f-8160e29]
    at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:828) [spigot-1.15.2.jar:git-Spigot-800b93f-8160e29]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_241]

    If anyone knows of a way to fix this, it would be greatly appreciated. Thanks!
     
  2. md_5

    Administrator Developer