Don't know how to go further.

Discussion in 'Plugin Development' started by rubenio1, Aug 25, 2018.

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

    timtower Administrator Administrator Moderator

    @rubenio1 Then post what you have tried.
     
  2. Offline

    KarimAKL

    Would probably help if you showed what you have tried.
    EDIT: Couldn't see timtower's post for some reason.
     
  3. I tried things like this because I don't get how you can delete it with itemstack.
    consumeItem(sender, 1, Material.LOG);
    Then I have this error:
    Code:Java
    1.  
    2. [14:41:41 INFO]: rubenio1 issued server command: /logtowood1
    3. [14:41:41 ERROR]: null
    4. org.bukkit.command.CommandException: Unhandled exception executing command 'logtowood1' in plugin Fabric v1.0
    5. at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[craftbukkit-1.12.2.jar:git-Bukkit-2b93d83]
    6. at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:140) ~[craftbukkit-1.12.2.jar:git-Bukkit-2b93d83]
    7. at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchCommand(CraftServer.java:628) ~[craftbukkit-1.12.2.jar:git-Bukkit-2b93d83]
    8. at net.minecraft.server.v1_12_R1.PlayerConnection.handleCommand(PlayerConnection.java:1338) [craftbukkit-1.12.2.jar:git-Bukkit-2b93d83]
    9. at net.minecraft.server.v1_12_R1.PlayerConnection.a(PlayerConnection.java:1198) [craftbukkit-1.12.2.jar:git-Bukkit-2b93d83]
    10. at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(SourceFile:37) [craftbukkit-1.12.2.jar:git-Bukkit-2b93d83]
    11. at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(SourceFile:9) [craftbukkit-1.12.2.jar:git-Bukkit-2b93d83]
    12. at net.minecraft.server.v1_12_R1.PlayerConnectionUtils$1.run(SourceFile:13) [craftbukkit-1.12.2.jar:git-Bukkit-2b93d83]
    13. at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_181]
    14. at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_181]
    15. at net.minecraft.server.v1_12_R1.SystemUtils.a(SourceFile:46) [craftbukkit-1.12.2.jar:git-Bukkit-2b93d83]
    16. at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:696) [craftbukkit-1.12.2.jar:git-Bukkit-2b93d83]
    17. at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:371) [craftbukkit-1.12.2.jar:git-Bukkit-2b93d83]
    18. at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:651) [craftbukkit-1.12.2.jar:git-Bukkit-2b93d83]
    19. at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:555) [craftbukkit-1.12.2.jar:git-Bukkit-2b93d83]
    20. at java.lang.Thread.run(Unknown Source) [?:1.8.0_181]
    21. Caused by: java.lang.NoSuchFieldError: OAK_LOG
    22. at me.rubenio1.fabric.Fabric$EventsClass.onCommand(Fabric.java:31) ~[?:?]
    23. at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[craftbukkit-1.12.2.jar:git-Bukkit-2b93d83]
    24. ... 15 more
    25. >
    26.  
     
  4. Online

    timtower Administrator Administrator Moderator

    @rubenio1 Compile with the same version as the server is running.
     
  5. The plugin is the same version as the server?
     
  6. Online

    timtower Administrator Administrator Moderator

    @rubenio1 Then how are you using 1.13 Materials on a 1.12 server?
     
  7. I'm coding in 1,12,2
     
  8. Offline

    Zombie_Striker

    @rubenio1
    Yes, so compile the plugin using 1.12. The "Oak_LOG" value is only for 1.13 and up. For 1.12 and lower, you need to use LOG with durability 0.
     
  9. At the moment I have 1 problem (this is my code: https://pastebin.com/crUrZxsC )
    the problem is when a player has 64 oak logs in his inventory it transfer it to 1 oak plank. I want it to make 64 of it then. When there are 32 logs in his inventory it must to be transferred to 32 planks,... How can I fix this?
     
  10. Offline

    Zombie_Striker

    for (ItemStack is : ((HumanEntity) sender).getInventory().addItem(new ItemStack(Material.WOOD, 1 /*amount of items*/, (short) 0 /*damage value*/)).values()) {

    The reason only one is added to the inventory is because you specify that only 1 of the item should be added. To change the amount of wood added, change the "1" to the amount you want.
     
Thread Status:
Not open for further replies.

Share This Page