Jump to content

[SOLVED] [1.16] null key in entry, Failed to load datapacks


kiou.23

Recommended Posts

I have a class that extends IRecipe, with it's own serializer and builder.

I'm registering the Serializer with a deferredRegister, and I'm registering the recipe type by calling IRecipeType.register in the registry event for the recipe serializers.

I'm generating a file using the recipe builder, it works fine. but whenever I try to load a world it gives the following error:

https://gist.github.com/jvcmarcenes/0ef3c7b8eeabf94efce04fd40215cafa

 

this is the recipe file (generated [main]/resources/data/minecraft/recipes/diamond_mod_recipe.json):

{
  "type": "tca:mod_shaped",
  "energy_cost": 100,
  "pattern": [
    "ddd",
    "dgd",
    "ddd"
  ],
  "key": {
    "d": {
      "item": "minecraft:dirt"
    },
    "g": {
      "item": "minecraft:gold_block"
    }
  },
  "result": {
    "item": "minecraft:diamond"
  }
}

 

and this is the generated file fot the criterion (generated [main]/resources/data/minecraft/advancements/recipes/misc/diamond_mod_recipe.json):

{
  "parent": "minecraft:recipes/root",
  "rewards": {
    "recipes": [
      "minecraft:diamond_mod_recipe"
    ]
  },
  "criteria": {
    "has_item": {
      "trigger": "minecraft:inventory_changed",
      "conditions": {
        "items": [
          {
            "item": "minecraft:gold_block"
          }
        ]
      }
    },
    "has_the_recipe": {
      "trigger": "minecraft:recipe_unlocked",
      "conditions": {
        "recipe": "minecraft:diamond_mod_recipe"
      }
    }
  },
  "requirements": [
    [
      "has_item",
      "has_the_recipe"
    ]
  ]
}

 

Edited by kiou.23
Link to comment
Share on other sites

1 hour ago, diesieben07 said:
  • Your Mod ID is too short and not unique.

Yeah, I've been told, I'l change it later

1 hour ago, diesieben07 said:
  • This error happens if your IRecipe returns null in getType.

I added the IRecipe before the RecipeType, so I made it return null and forgot about it...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.