Using Soul Jar in Custom Crop does not work.
thepriz opened this issue ยท 1 comments
Describe the bug
I added a custom crop for a phantom using a Soul Jar ingredient and it does not create the seeds and essence.
To Reproduce
Create a phantom.json file in the config\mysticalcustomization\mobsoultypes folder like (This produces the Soul Jar):
{
"name": "Phantom",
"souls": 12,
"entities": [
"minecraft:phantom"
],
"color": "2f3964"
}
Create a phantom.json file in the config\mysticalcustomization\crops folder like:
{
"name": "Phantom",
"type": "mysticalagriculture:mob",
"tier": "mysticalagriculture:3",
"ingredient": {
{
"type": "forge:partial_nbt",
"item": "mysticalagriculture:soul_jar",
"nbt": {
"Type": "mysticalcustomization:phantom",
"Souls": 12.0
}
}
},
"color": "2f3964",
"textures": {
"flower": "mysticalagriculture:block/flower_dust",
"essence": "mysticalagriculture:item/essence_dust",
"seeds": "mysticalagriculture:item/mystical_seeds"
}
}
This does not create the seeds and essences. However, if I change the ingredient item to "item": "minecraft:phantom_membrane" it works.
Expected behavior
This should create the recipes for the Phantom Seed, and Phantom Essence.
Screenshots / Scripts / Logs
This is the log error:
[00:28:41] [Render thread/ERROR]: An error occurred while creating crop with id null
com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Expected name at line 6 column 4 path $.ingredient.
at com.google.gson.internal.Streams.parse(Streams.java:61) ~[gson-2.10.jar%23107!/:?]
at com.google.gson.JsonParser.parseReader(JsonParser.java:102) ~[gson-2.10.jar%23107!/:?]
at com.google.gson.JsonParser.parseReader(JsonParser.java:70) ~[gson-2.10.jar%23107!/:?]
at com.google.gson.JsonParser.parse(JsonParser.java:121) ~[gson-2.10.jar%23107!/:?]
at com.blakebr0.mysticalcustomization.loader.CropLoader.onRegisterCrops(CropLoader.java:56) ~[MysticalCustomization-1.20.1-5.0.1.jar%23947!/:5.0.1]
at com.blakebr0.mysticalcustomization.lib.ModCorePlugin.onRegisterCrops(ModCorePlugin.java:20) ~[MysticalCustomization-1.20.1-5.0.1.jar%23947!/:5.0.1]
at com.blakebr0.mysticalagriculture.registry.CropRegistry.lambda$onRegisterBlocks$2(CropRegistry.java:118) ~[MysticalAgriculture-1.20.1-7.0.11.jar%23946!/:7.0.11]
at java.util.LinkedHashMap.forEach(LinkedHashMap.java:721) ~[?:?]
at com.blakebr0.mysticalagriculture.registry.PluginRegistry.forEach(PluginRegistry.java:52) ~[MysticalAgriculture-1.20.1-7.0.11.jar%23946!/:7.0.11]
at com.blakebr0.mysticalagriculture.registry.CropRegistry.onRegisterBlocks(CropRegistry.java:115) ~[MysticalAgriculture-1.20.1-7.0.11.jar%23946!/:7.0.11]
at com.blakebr0.mysticalagriculture.init.ModBlocks.lambda$onRegisterBlocks$58(ModBlocks.java:135) ~[MysticalAgriculture-1.20.1-7.0.11.jar%23946!/:7.0.11]
at net.minecraftforge.registries.RegisterEvent.register(RegisterEvent.java:76) ~[forge-1.20.1-47.2.20-universal.jar%231117!/:?]
at com.blakebr0.mysticalagriculture.init.ModBlocks.onRegisterBlocks(ModBlocks.java:129) ~[MysticalAgriculture-1.20.1-7.0.11.jar%23946!/:7.0.11]
at com.blakebr0.mysticalagriculture.init.__ModBlocks_onRegisterBlocks_RegisterEvent.invoke(.dynamic) ~[MysticalAgriculture-1.20.1-7.0.11.jar%23946!/:7.0.11]
at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:73) ~[eventbus-6.0.5.jar%2387!/:?]
at net.minecraftforge.eventbus.EventBus.post(EventBus.java:315) ~[eventbus-6.0.5.jar%2387!/:?]
at net.minecraftforge.eventbus.EventBus.post(EventBus.java:296) ~[eventbus-6.0.5.jar%2387!/:?]
at net.minecraftforge.fml.javafmlmod.FMLModContainer.acceptEvent(FMLModContainer.java:114) ~[javafmllanguage-1.20.1-47.2.20.jar%231114!/:?]
at net.minecraftforge.fml.ModLoader.lambda$postEventWithWrapInModOrder$33(ModLoader.java:346) ~[fmlcore-1.20.1-47.2.20.jar%231113!/:?]
at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?]
at net.minecraftforge.fml.ModList.forEachModInOrder(ModList.java:227) ~[fmlcore-1.20.1-47.2.20.jar%231113!/:?]
at net.minecraftforge.fml.ModLoader.postEventWithWrapInModOrder(ModLoader.java:344) ~[fmlcore-1.20.1-47.2.20.jar%231113!/:?]
at net.minecraftforge.fml.ModLoader.postEventWrapContainerInModOrder(ModLoader.java:337) ~[fmlcore-1.20.1-47.2.20.jar%231113!/:?]
at net.minecraftforge.registries.GameData.postRegisterEvents(GameData.java:329) ~[forge-1.20.1-47.2.20-universal.jar%231117!/:?]
at net.minecraftforge.common.ForgeStatesProvider.lambda$new$4(ForgeStatesProvider.java:25) ~[forge-1.20.1-47.2.20-universal.jar%231117!/:?]
at net.minecraftforge.fml.ModLoader.handleInlineTransition(ModLoader.java:217) ~[fmlcore-1.20.1-47.2.20.jar%231113!/:?]
at net.minecraftforge.fml.ModLoader.lambda$dispatchAndHandleError$19(ModLoader.java:209) ~[fmlcore-1.20.1-47.2.20.jar%231113!/:?]
at java.util.Optional.ifPresent(Optional.java:178) ~[?:?]
at net.minecraftforge.fml.ModLoader.dispatchAndHandleError(ModLoader.java:209) ~[fmlcore-1.20.1-47.2.20.jar%231113!/:?]
at net.minecraftforge.fml.ModLoader.lambda$gatherAndInitializeMods$13(ModLoader.java:183) ~[fmlcore-1.20.1-47.2.20.jar%231113!/:?]
at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?]
at net.minecraftforge.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:183) ~[fmlcore-1.20.1-47.2.20.jar%231113!/:?]
at net.minecraftforge.client.loading.ClientModLoader.lambda$begin$1(ClientModLoader.java:70) ~[forge-1.20.1-47.2.20-universal.jar%231117!/:?]
at net.minecraftforge.client.loading.ClientModLoader.lambda$createRunnableWithCatch$4(ClientModLoader.java:90) ~[forge-1.20.1-47.2.20-universal.jar%231117!/:?]
at net.minecraftforge.client.loading.ClientModLoader.begin(ClientModLoader.java:70) ~[forge-1.20.1-47.2.20-universal.jar%231117!/:?]
at net.minecraft.client.Minecraft.(Minecraft.java:459) ~[client-1.20.1-20230612.114412-srg.jar%231112!/:?]
at net.minecraft.client.main.Main.main(Main.java:182) ~[forge-47.2.20.jar:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
at net.minecraftforge.fml.loading.targets.CommonLaunchHandler.runTarget(CommonLaunchHandler.java:111) ~[fmlloader-1.20.1-47.2.20.jar:?]
at net.minecraftforge.fml.loading.targets.CommonLaunchHandler.clientService(CommonLaunchHandler.java:99) ~[fmlloader-1.20.1-47.2.20.jar:?]
at net.minecraftforge.fml.loading.targets.CommonClientLaunchHandler.lambda$makeService$0(CommonClientLaunchHandler.java:25) ~[fmlloader-1.20.1-47.2.20.jar:?]
at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:30) ~[modlauncher-10.0.9.jar:?]
at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) ~[modlauncher-10.0.9.jar:?]
at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) ~[modlauncher-10.0.9.jar:?]
at cpw.mods.modlauncher.Launcher.run(Launcher.java:108) ~[modlauncher-10.0.9.jar:?]
at cpw.mods.modlauncher.Launcher.main(Launcher.java:78) ~[modlauncher-10.0.9.jar:?]
at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) ~[modlauncher-10.0.9.jar:?]
at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) ~[modlauncher-10.0.9.jar:?]
at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:141) ~[bootstraplauncher-1.1.2.jar:?]
Caused by: com.google.gson.stream.MalformedJsonException: Expected name at line 6 column 4 path $.ingredient.
at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1657) ~[gson-2.10.jar%23107!/:?]
at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:522) ~[gson-2.10.jar%23107!/:?]
at com.google.gson.stream.JsonReader.hasNext(JsonReader.java:422) ~[gson-2.10.jar%23107!/:?]
at com.google.gson.internal.bind.TypeAdapters$28.read(TypeAdapters.java:779) ~[gson-2.10.jar%23107!/:?]
at com.google.gson.internal.bind.TypeAdapters$28.read(TypeAdapters.java:725) ~[gson-2.10.jar%23107!/:?]
at com.google.gson.internal.Streams.parse(Streams.java:49) ~[gson-2.10.jar%23107!/:?]
... 51 more
Versions (please complete the following information):
- Minecraft: 1.20.1
- Forge: 47.2.20
- Cucumber: 1.20.1-7.0.8
- Mystical Agriculture: 1.20.1-7.0.11
- Mystical Customization: 1.20.1-5.0.1
- Singleplayer or Multiplayer: Singleplayer
I figured out the issue. I had to take out the extra braces in the ingredients. so the final config looks like this:
{
"name": "Phantom",
"type": "mysticalagriculture:mob",
"tier": "mysticalagriculture:3",
"ingredient": {
"type": "forge:partial_nbt",
"item": "mysticalagriculture:soul_jar",
"nbt": {
"Type": "mysticalcustomization:phantom",
"Souls": 12.0
}
},
"color": "2f3964",
"textures": {
"flower": "mysticalagriculture:block/flower_dust",
"essence": "mysticalagriculture:item/essence_dust",
"seeds": "mysticalagriculture:item/mystical_seeds"
}
}