Jump to content

Recommended Posts

Posted (edited)

Hi,
I am just updating my mod from 1.20.1 to 1.20.2 and I saw a big change for the custom RecipeSerializers, they now require Codec<?> serialization instead of a simple fromJson() function.
Unfortunately, I am struggling with setting up the Codec for a few of the serialization features:

- Using the Forge "mod_loaded" condition (the file should not be loaded when a mod is missing)

- Loading an Ingredient field 

Current Codec Code:

  Reveal hidden contents

The "cagedmobs:environments/red_mushroom_block" JSON recipe:

  Reveal hidden contents

 

Edited by Corgam
Posted (edited)

The problem is not the 'input' field its' the 'render' field.
You expect there a BlockState but 'minecraft:red_mushroom_block' is a Block.

If you need no BlockState you can use ForgeRegistries.BLOCKS.getCodec() instead of BlockState.CODEC.
If you need explicit a BlockState take a look at the Codec which fields are required.

Edited by Luis_ST
  • Like 1

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.