Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

  • Author
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...

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.