Craftbook Custom Block Drops error
LadyCailinBot opened this issue · 14 comments
CRAFTBOOK-3331 - Reported by andy.1
I watched tutorials and it looks as if i'm doing the syntax correctly, I have customdrops enabled in my config and have reloaded and restarted multiple times but for some reason the configuration that I entered for the custom block drops seem to not be working. Help would be appreciated, thanks.
Here's the custom drop that I tried to add (I want there to be an 85% chance of gravel, 10% chance of flint, and a 5% of cobblestone once a gravel block is destroyed):
graveldrop:
block: "GRAVEL"
drops:
Cobblestones:
item: "COBBLESTONE"
chance: 5
minimum-amount: 1
maximum-amount: 1
Gravels:
item: "GRAVEL"
chance: 90
minimum-amount: 1
maximum-amount: 1
Flints:
item: "FLINT"
chance: 10
minimum-amount: 1
maximum-amount: 1
type: block
append: false
And I also keep getting this error:
[CraftBook] Registered 3 custom recipes!
[19:48:01 WARN]: [CraftBook] Failed to enable mechanic: CustomDrops
java.lang.NullPointerException
at com.sk89q.craftbook.mechanics.drops.CustomDrops.load(CustomDrops.java:112) ~[craftbook-3.9-SNAPSHOT.jar:3.9-SNAPSHOT]
at com.sk89q.craftbook.mechanics.drops.CustomDrops.enable(CustomDrops.java:44) ~[craftbook-3.9-SNAPSHOT.jar:3.9-SNAPSHOT]
at com.sk89q.craftbook.bukkit.CraftBookPlugin.setupCraftBook(CraftBookPlugin.java:478) [craftbook-3.9-SNAPSHOT.jar:3.9-SNAPSHOT]
at com.sk89q.craftbook.bukkit.CraftBookPlugin.reloadConfiguration(CraftBookPlugin.java:1010) [craftbook-3.9-SNAPSHOT.jar:3.9-SNAPSHOT]
at com.sk89q.craftbook.bukkit.commands.TopLevelCommands$Commands.reload(TopLevelCommands.java:98) [craftbook-3.9-SNAPSHOT.jar:3.9-SNAPSHOT]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_112]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_112]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_112]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_112]
at com.sk89q.minecraft.util.commands.CommandsManager.invokeMethod(CommandsManager.java:528) [worldedit-bukkit-6.1.5.jar:?]
at com.sk89q.minecraft.util.commands.CommandsManager.executeMethod(CommandsManager.java:516) [worldedit-bukkit-6.1.5.jar:?]
at com.sk89q.minecraft.util.commands.CommandsManager.executeMethod(CommandsManager.java:471) [worldedit-bukkit-6.1.5.jar:?]
at com.sk89q.minecraft.util.commands.CommandsManager.execute(CommandsManager.java:409) [worldedit-bukkit-6.1.5.jar:?]
at com.sk89q.craftbook.bukkit.CraftBookPlugin.onCommand(CraftBookPlugin.java:689) [craftbook-3.9-SNAPSHOT.jar:3.9-SNAPSHOT]
at com.sk89q.bukkit.util.DynamicPluginCommand.execute(DynamicPluginCommand.java:54) [worldedit-bukkit-6.1.5.jar:?]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:151) [patched.jar:git-TacoSpigot-"2cf491a"]
at org.bukkit.craftbukkit.v1_11_R1.CraftServer.dispatchCommand(CraftServer.java:674) [patched.jar:git-TacoSpigot-"2cf491a"]
at net.minecraft.server.v1_11_R1.PlayerConnection.handleCommand(PlayerConnection.java:1375) [patched.jar:git-TacoSpigot-"2cf491a"]
at net.minecraft.server.v1_11_R1.PlayerConnection.a(PlayerConnection.java:1180) [patched.jar:git-TacoSpigot-"2cf491a"]
at net.minecraft.server.v1_11_R1.PacketPlayInChat.a(PacketPlayInChat.java:45) [patched.jar:git-TacoSpigot-"2cf491a"]
at net.minecraft.server.v1_11_R1.PacketPlayInChat.a(PacketPlayInChat.java:5) [patched.jar:git-TacoSpigot-"2cf491a"]
at net.minecraft.server.v1_11_R1.PlayerConnectionUtils$1.run(SourceFile:13) [patched.jar:git-TacoSpigot-"2cf491a"]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_112]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_112]
at net.minecraft.server.v1_11_R1.SystemUtils.a(SourceFile:46) [patched.jar:git-TacoSpigot-"2cf491a"]
at net.minecraft.server.v1_11_R1.MinecraftServer.D(MinecraftServer.java:817) [patched.jar:git-TacoSpigot-"2cf491a"]
at net.minecraft.server.v1_11_R1.DedicatedServer.D(DedicatedServer.java:403) [patched.jar:git-TacoSpigot-"2cf491a"]
at net.minecraft.server.v1_11_R1.MinecraftServer.C(MinecraftServer.java:749) [patched.jar:git-TacoSpigot-"2cf491a"]
at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.java:648) [patched.jar:git-TacoSpigot-"2cf491a"]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_112]
Help on how to solve this would be greatly appreciated.
Comment by me4502
I can’t tell too well as pasting it directly into the site kinda breaks indentation, but is your type and append entry inside the drops closure? Make sure it’s at the same indentation level as the block entry.
Comment by andy.1
Of course i have correct syntax! :)
https://pastebin.com/mx1Eqhjx
Comment by me4502
Yeah, the indentation or type and append is wrong. It should be on the prior indentation level.
Comment by andy.1
Well i fixed the syntax reloaded the config yet destroying gravel still doesn't yield 5%cobblestone, 85%gravel, and 10% flint.
Comment by me4502
Are there any errors? What does happen when you break the gravel?
Comment by andy.1
And yes it's enabled in my config if that's what you're wondering. By the way thanks for helping me out so
far.
Comment by me4502
It's working fine for me on a test server, using the config you provided (with the indentation fixed).
What version of CraftBook and Spigot are you using?
Comment by andy.1
I'm using Spigot 1.11.2 (java8) and my CraftBook version is Craftbook version 3.9-snapshot-jenkins-craftbook-148 Founded by sk89q, and currently developed by Me4502 & dark_arc
Comment by me4502
Try this version, it's the final for 1.11.2, https://ci.md-5.net/job/CraftBook/156/artifact/target/craftbook-3.9-SNAPSHOT.jar
Comment by andy.1
do you have to remove the examples for the custom drops to work?
Comment by me4502
No, as long as you've named the definitions differently to the examples.