Jump to content

[SOLVE][1.18.2] Mod Entity Types .get() gives error!


FantaLaTone

Recommended Posts

Hi! I have a mod entity class, model, renderer. I got error about types are not match. I am trying to fix it for the last 2 hours. Please help me.

MainModFile.java (I get where it says ModEntityTypes.WANDERING_RAIDER.get(). It says "reason: Incompatible parameter types in method reference expression" )

private void clientSetup(final FMLClientSetupEvent event) {
        ItemBlockRenderTypes.setRenderLayer(ModBlocks.GOLDEN_OAK_LEAVES.get(), RenderType.cutout());
        ItemBlockRenderTypes.setRenderLayer(ModBlocks.GOLDEN_OAK_SAPLING.get(), RenderType.cutout());

        EntityRenderers.register(ModEntityTypes.WANDERING_RAIDER.get(), EntityWanderingRaider::new);
    }

Entity Class

https://pastebin.com/ktaFry3Q

Mod Entity Types

public static final DeferredRegister<EntityType<?>> ENTITY_TYPES = DeferredRegister.create(ForgeRegistries.ENTITIES,
            BetterMinecraftMod.MODID);

    public static final RegistryObject<EntityType<EntityWanderingRaider>> WANDERING_RAIDER = ENTITY_TYPES.register(
            "wandering_raider",
            () -> EntityType.Builder.of(EntityWanderingRaider::new, MobCategory.MONSTER)
                    .sized(0.6f, 1.95f)
                    .clientTrackingRange(10).build(new ResourceLocation(BetterMinecraftMod.MODID, "wandering_raider").toString())
    );

    public static void register(IEventBus bus) {
        ENTITY_TYPES.register(bus);
    }

 

Edited by FantaLaTone
solved
Link to comment
Share on other sites

  • FantaLaTone changed the title to [SOLVE][1.18.2] Mod Entity Types .get() gives error!

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.