Jump to content

Registry Object not present


TruePestilence

Recommended Posts

Hello. For my Minecraft mod, I have been trying to update it from 1.19 to 1.20. However, I'm suddenly having a strange issue regarding the registry of my BlockEntities.

It claims that the registry object for breeding_structure isn't present twice. This wasn't a problem in my 1.19 code, so I'm stuck on what the issue could be.

Here are the snippets of code listed by the Stacktrace, and the code relevant to the breeding structure block entity.

public static final RegistryObject<Block> BREEDING_STRUCTURE = registerBlock("breeding_structure",
            () -> new BreedingStructure(BlockBehaviour.Properties.copy(Blocks.OAK_LOG)
                    .strength(2F,2F).noOcclusion())
            );
private static <T extends Block> RegistryObject<Item> registerBlockItem(String name, RegistryObject<T> block) {
        return ModItems.ITEMS.register(name, () -> new BlockItem(block.get(), new Item.Properties()));
    }
public static final RegistryObject<BlockEntityType<BreedingStructureEntity>> BREEDING_STRUCTURE =
            BLOCK_ENTITIES.register("breeding_structure", () ->
                    BlockEntityType.Builder.of(BreedingStructureEntity::new,
                            ModBlocks.BREEDING_STRUCTURE.get()).build(null));

I believe it's likely ModBlocks.BREEDING_STRUCTURE.get(), but I'm totally lost on how.

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.