Jump to content

1.16.5 Entity Render Register Issue


RoggyMan01

Recommended Posts

I'm new to forge developing, and I'm trying to create an entity for a mod. I got stuck when I had to register the rendering for the model, I'm using this:

 

RenderingRegistry.registerEntityRenderingHandler(ModEntityTypes.EXAMPLE_ENTITY.get(), new ExampleEntityRenderer ,2);

 

The part that isn't recognized by the code is "new ExampleEntity", what is it expecting to be in there?

Link to comment
Share on other sites

I tried this method I found:

public static void registerRenders() {
        RenderingRegistry.registerEntityRenderingHandler(ExampleEntity.class, new IRenderFactory<ExampleEntity>() {
            @Override
            public EntityRenderer<? super ExampleEntity> createRenderFor(EntityRendererManager manager) {
                return null;
            }

            public Render<? super ExampleEntity> createRenderFor(RenderManager manager) {
                return new ExampleEntityRenderer(manager);
            }
        });
    }

But "Render", "RenderManager" and "manager" don't seem to be recognised by the code.

Link to comment
Share on other sites

Okay, I figured it out, thank you so much. But now I'm trying to summon the entity in-game, and I'm getting the "unable to summon entity" error, and this log:

java.lang.NullPointerException: Cannot invoke "net.minecraft.entity.ai.attributes.AttributeModifierMap.getValue(net.minecraft.entity.ai.attributes.Attribute)" because "this.supplier" is null
	at net.minecraft.entity.ai.attributes.AttributeModifierManager.getValue(AttributeModifierManager.java:67) ~[forge-1.16.5-36.1.0_mapped_official_1.16.1-recomp.jar:?] {re:classloading}
	at net.minecraft.entity.LivingEntity.getAttributeValue(LivingEntity.java:1729) ~[forge-1.16.5-36.1.0_mapped_official_1.16.1-recomp.jar:?] {re:classloading}
	at net.minecraft.entity.LivingEntity.getMaxHealth(LivingEntity.java:1509) ~[forge-1.16.5-36.1.0_mapped_official_1.16.1-recomp.jar:?] {re:classloading}
	at net.minecraft.entity.LivingEntity.<init>(LivingEntity.java:207) ~[forge-1.16.5-36.1.0_mapped_official_1.16.1-recomp.jar:?] {re:classloading}
	at net.minecraft.entity.MobEntity.<init>(MobEntity.java:108) ~[forge-1.16.5-36.1.0_mapped_official_1.16.1-recomp.jar:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.entity.CreatureEntity.<init>(CreatureEntity.java:13) ~[forge-1.16.5-36.1.0_mapped_official_1.16.1-recomp.jar:?] {re:classloading}
	at net.minecraft.entity.AgeableEntity.<init>(AgeableEntity.java:21) ~[forge-1.16.5-36.1.0_mapped_official_1.16.1-recomp.jar:?] {re:classloading}
	at net.minecraft.entity.passive.AnimalEntity.<init>(AnimalEntity.java:37) ~[forge-1.16.5-36.1.0_mapped_official_1.16.1-recomp.jar:?] {re:classloading}
	at net.roggyman01.rumbamod.entity.custom.ExampleEntity.<init>(ExampleEntity.java:26) ~[main/:?] {re:classloading}
	at net.minecraft.entity.EntityType.create(EntityType.java:445) ~[forge-1.16.5-36.1.0_mapped_official_1.16.1-recomp.jar:?] {re:classloading}
	at net.minecraft.entity.EntityType.lambda$create$1(EntityType.java:456) ~[forge-1.16.5-36.1.0_mapped_official_1.16.1-recomp.jar:?] {re:classloading}
	at java.util.Optional.map(Optional.java:258) ~[?:?] {}
	at net.minecraft.entity.EntityType.create(EntityType.java:455) ~[forge-1.16.5-36.1.0_mapped_official_1.16.1-recomp.jar:?] {re:classloading}
	at net.minecraft.entity.EntityType.loadStaticEntity(EntityType.java:513) ~[forge-1.16.5-36.1.0_mapped_official_1.16.1-recomp.jar:?] {re:classloading}
	at net.minecraft.entity.EntityType.loadEntityRecursive(EntityType.java:495) ~[forge-1.16.5-36.1.0_mapped_official_1.16.1-recomp.jar:?] {re:classloading}
	at net.minecraft.command.impl.SummonCommand.spawnEntity(SummonCommand.java:50) ~[forge-1.16.5-36.1.0_mapped_official_1.16.1-recomp.jar:?] {re:classloading}
	at net.minecraft.command.impl.SummonCommand.lambda$register$1(SummonCommand.java:34) ~[forge-1.16.5-36.1.0_mapped_official_1.16.1-recomp.jar:?] {re:classloading}
	at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:262) ~[brigadier-1.0.17.jar:?] {re:classloading}
	at net.minecraft.command.Commands.performCommand(Commands.java:217) ~[forge:?] {re:classloading}
	at net.minecraft.network.play.ServerPlayNetHandler.handleCommand(ServerPlayNetHandler.java:1119) ~[forge:?] {re:classloading}
	at net.minecraft.network.play.ServerPlayNetHandler.func_244548_c(ServerPlayNetHandler.java:1102) ~[forge:?] {re:classloading}
	at net.minecraft.network.play.ServerPlayNetHandler.handleChat(ServerPlayNetHandler.java:1081) ~[forge:?] {re:classloading}
	at net.minecraft.network.play.client.CChatMessagePacket.handle(CChatMessagePacket.java:31) ~[forge:?] {re:classloading}
	at net.minecraft.network.play.client.CChatMessagePacket.handle(CChatMessagePacket.java:8) ~[forge:?] {re:classloading}
	at net.minecraft.network.PacketThreadUtil.lambda$ensureRunningOnSameThread$0(PacketThreadUtil.java:19) ~[forge:?] {re:classloading}
	at net.minecraft.util.concurrent.TickDelayedTask.run(TickDelayedTask.java:17) ~[forge:?] {re:classloading}
	at net.minecraft.util.concurrent.ThreadTaskExecutor.doRunTask(ThreadTaskExecutor.java:136) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.util.concurrent.RecursiveEventLoop.doRunTask(RecursiveEventLoop.java:22) ~[forge:?] {re:classloading}
	at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:734) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:159) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.util.concurrent.ThreadTaskExecutor.pollTask(ThreadTaskExecutor.java:109) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:717) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:711) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.util.concurrent.ThreadTaskExecutor.managedBlock(ThreadTaskExecutor.java:119) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:697) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:646) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:232) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at java.lang.Thread.run(Thread.java:832) [?:?] {}
[15:22:56] [Render thread/INFO] [minecraft/NewChatGui]: [CHAT] Unable to summon entity

What does this mean?

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.