1.15.2 How to open Anvil Inventory?

Discussion in 'Spigot Plugin Development' started by AtBar666, Mar 21, 2020.

  1. Hi, everybody
    I want to open an anvil Inventory by command
    Can you help me?
    Thanks.
     
  2. Create inventory by InventoryType.
    Code (Java):
    Inventory inv = Bukkit.createInventory(null, InventoryType.ANVIL);
    player.openInventory(inv);
     
  3. But if you click this inventory, there will be an error
     
  4. Show your code and the "error".
     
  5. [20:35:00] [Server thread/FATAL]: Error executing task on Server
    java.lang.UnsupportedOperationException: Not supported yet.
    at net.minecraft.server.v1_15_R1.ContainerAccess.getWorld(ContainerAccess.java:11) ~[patched_1.15.2.jar:git-Paper-133]
    at net.minecraft.server.v1_15_R1.ContainerAccess.getLocation(ContainerAccess.java:19) ~[patched_1.15.2.jar:git-Paper-133]
    at net.minecraft.server.v1_15_R1.ContainerAnvil.getBukkitView(ContainerAnvil.java:404) ~[patched_1.15.2.jar:git-Paper-133]
    at net.minecraft.server.v1_15_R1.ContainerAnvil.e(ContainerAnvil.java:147) ~[patched_1.15.2.jar:git-Paper-133]
    at net.minecraft.server.v1_15_R1.ContainerAnvil.a(ContainerAnvil.java:133) ~[patched_1.15.2.jar:git-Paper-133]
    at net.minecraft.server.v1_15_R1.ContainerAnvil$1.update(ContainerAnvil.java:42) ~[patched_1.15.2.jar:git-Paper-133]
    at net.minecraft.server.v1_15_R1.Slot.d(SourceFile:87) ~[patched_1.15.2.jar:git-Paper-133]
    at net.minecraft.server.v1_15_R1.Container.a(Container.java:381) ~[patched_1.15.2.jar:git-Paper-133]
    at net.minecraft.server.v1_15_R1.PlayerConnection.a(PlayerConnection.java:2341) ~[patched_1.15.2.jar:git-Paper-133]
    at net.minecraft.server.v1_15_R1.PacketPlayInWindowClick.a(SourceFile:32) ~[patched_1.15.2.jar:git-Paper-133]
    at net.minecraft.server.v1_15_R1.PacketPlayInWindowClick.a(SourceFile:10) ~[patched_1.15.2.jar:git-Paper-133]
    at net.minecraft.server.v1_15_R1.PlayerConnectionUtils.lambda$ensureMainThread$0(PlayerConnectionUtils.java:23) ~[patched_1.15.2.jar:git-Paper-133]
    at net.minecraft.server.v1_15_R1.TickTask.run(SourceFile:18) ~[patched_1.15.2.jar:git-Paper-133]
    at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136) ~[patched_1.15.2.jar:git-Paper-133]
    at net.minecraft.server.v1_15_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[patched_1.15.2.jar:git-Paper-133]
    at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109) ~[patched_1.15.2.jar:git-Paper-133]
    at net.minecraft.server.v1_15_R1.MinecraftServer.ba(MinecraftServer.java:1038) ~[patched_1.15.2.jar:git-Paper-133]
    at net.minecraft.server.v1_15_R1.MinecraftServer.executeNext(MinecraftServer.java:1031) ~[patched_1.15.2.jar:git-Paper-133]
    at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119) ~[patched_1.15.2.jar:git-Paper-133]
    at net.minecraft.server.v1_15_R1.MinecraftServer.sleepForTick(MinecraftServer.java:1015) ~[patched_1.15.2.jar:git-Paper-133]
    at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:938) ~[patched_1.15.2.jar:git-Paper-133]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_191]
     
  6. Post your error and your code.
     
  7. upload_2020-3-21_20-45-9.png
     

    Attached Files:

  8. java.lang.UnsupportedOperationException: Not supported yet.

    You have to wait. Alternatively you can also contribute to the project and implement it.
     
  9. oh, Thanks
     
  10. But there are some APIs which work wonderfully. You should take a look at them.