Jump to content

Crash after entity creation [1.16.5]


toad132

Recommended Posts

I creates an entity, its render and model(in Blockbench), but soon as I want spawn it, minecraft crashes.

 

please help fix this.

 

P.S English is not my native language.

 

Edited by toad132
Link to comment
Share on other sites

10 hours ago, toad132 said:

 

crash log

java.lang.NullPointerException: Cannot invoke "net.minecraft.client.renderer.entity.EntityRenderer.shouldRender(net.minecraft.entity.Entity, net.minecraft.client.renderer.culling.ClippingHelper, double, double, double)" because "entityrenderer" is null
    at net.minecraft.client.renderer.entity.EntityRendererManager.shouldRender(EntityRendererManager.java:239) ~[forge-1.16.5-36.2.35_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.renderer.WorldRenderer.updateCameraAndRender(WorldRenderer.java:1009) ~[forge-1.16.5-36.2.35_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraft.client.renderer.GameRenderer.renderWorld(GameRenderer.java:620) ~[forge-1.16.5-36.2.35_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.renderer.GameRenderer.updateCameraAndRender(GameRenderer.java:437) ~[forge-1.16.5-36.2.35_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1003) ~[forge-1.16.5-36.2.35_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.run(Minecraft.java:612) ~[forge-1.16.5-36.2.35_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.main.Main.main(Main.java:184) ~[forge-1.16.5-36.2.35_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {}
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) ~[?:?] {}
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}
    at java.lang.reflect.Method.invoke(Method.java:567) ~[?:?] {}
    at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:38) ~[forge-1.16.5-36.2.35_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.1.3.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.1.3.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.1.3.jar:?] {}
    at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.1.3.jar:?] {}
    at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.1.3.jar:?] {}
    at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:94) [forge-1.16.5-36.2.35_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {}
 

my entity render

public class CrowRender extends MobRenderer<CrowEntity, CrowModel<CrowEntity>> {

protected static final ResourceLocation TEXTURE = new ResourceLocation(ue.MODID, "textures/entity/Crow/Crow1.png");

public CrowRender(EntityRendererManager renderManagerIn) { super(renderManagerIn, new CrowModel(), 0.3F); }

@Override public ResourceLocation getEntityTexture(CrowEntity entity) { return TEXTURE; }

 

please help fix this.

 

P.S English is not my native language.

 

 

Edited by toad132
Link to comment
Share on other sites

Have you registered your renderer? Something like the following in your FMLClientSetupEvent

Quote

RenderingRegistry.registerEntityRenderingHandler(YourCrowEntityType, CrowRender::new);

 

Edited by warjort

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Link to comment
Share on other sites

4 hours ago, diesieben07 said:

main class

private static final Logger LOGGER = LogManager.getLogger();

public static final String MODID = "ue";

public ue() {

ModEntityTypes.register(eventBus);

private void doClientStuff(final FMLClientSetupEvent event){

RenderingRegistry.registerEntityRenderingHandler(ModEntityTypes.CROW.get(), CrowRender::new);

 

 

4 hours ago, diesieben07 said:
4 hours ago, diesieben07 said:

 

Entity

public class CrowEntity extends ParrotEntity implements IFlyingAnimal

{

public CrowEntity(EntityType<? extends ParrotEntity> type, World worldIn) { super(type, worldIn); } public static AttributeModifierMap.MutableAttribute setCustomAttributes(){ return MobEntity.func_233666_p_() .

createMutableAttribute(Attributes.MAX_HEALTH, 10.00)

.createMutableAttribute(Attributes.MOVEMENT_SPEED, 0.7D)

.createMutableAttribute(Attributes.ATTACK_DAMAGE, 0.00)

.createMutableAttribute(Attributes.FLYING_SPEED, 0.5D); }

@Override protected int getExperiencePoints(PlayerEntity player){ return 1 + this.world.rand.nextInt(1);}

@Override public SoundEvent getAmbientSound (){return ModSoundEvents.CrowAmbient.get();}

@Override public SoundEvent getDeathSound (){return ModSoundEvents.CrowDeath.get();}

@Override public SoundEvent getHurtSound (DamageSource damageSourceIn){return ModSoundEvents.CrowHurt.get();}

@Override protected void playStepSound(BlockPos pos, BlockState state){ this.playSound(SoundEvents.ENTITY_PARROT_STEP, 0.15F, 1.0F); }

@Override protected float playFlySound(float volume){ this.playSound(SoundEvents.ENTITY_PARROT_FLY, 0.15F, 1.0F); return volume + this.flapSpeed / 2.0F; } public float flap;

 

EntityTypes

public class ModEntityTypes {

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

public static final RegistryObject<EntityType<CrowEntity>> CROW = ENTITY_TYPES.register("crow",()-> EntityType.Builder.create(CrowEntity::new, EntityClassification.AMBIENT).size(3f,3f) .build(new ResourceLocation(ue.MODID, "crow").toString()));

 

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

}

 

Link to comment
Share on other sites

first of all please show the full code not only a part (main class),
then please use the code feature of the forum or use a paste side

is your doClientStuff EventHandler called, use debugger to check?

Edited by Luis_ST
Link to comment
Share on other sites

main class

19 minutes ago, Luis_ST said:
mport com.mr_toad.ue.block.ModBlocks;
import com.mr_toad.ue.block.ModWoodTypes;
import com.mr_toad.ue.entity.ModEntityTypes;
import com.mr_toad.ue.entity.render.CrowRender;
import com.mr_toad.ue.item.ModItems;
import com.mr_toad.ue.util.ModSoundEvents;
import net.minecraft.block.Block;
import net.minecraft.block.ComposterBlock;
import net.minecraft.block.WoodType;
import net.minecraft.client.renderer.Atlases;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.RenderTypeLookup;
import net.minecraft.item.AxeItem;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.InterModComms;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent;
import net.minecraftforge.fml.event.lifecycle.InterModProcessEvent;
import net.minecraftforge.fml.event.server.FMLServerStartingEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.stream.Collectors;




@Mod(ue.MODID)
public class ue
{
    private static final Logger LOGGER = LogManager.getLogger();
    public static final String MODID = "ue";
    public ue() {

        IEventBus eventBus = FMLJavaModLoadingContext.get().getModEventBus();
        ModEntityTypes.register(eventBus);
        ModBlocks.register(eventBus);
        ModItems.register(eventBus);
        ModSoundEvents.register(eventBus);
        eventBus.addListener(this::setup);
        eventBus.addListener(this::enqueueIMC);
        eventBus.addListener(this::processIMC);
        eventBus.addListener(this::doClientStuff);


        MinecraftForge.EVENT_BUS.register(this);


    }






    private void setup(final FMLCommonSetupEvent event) {
        event.enqueueWork(()->{
            AxeItem.BLOCK_STRIPPING_MAP = new ImmutableMap.Builder<Block, Block>().putAll(AxeItem.BLOCK_STRIPPING_MAP)

                    .put(ModBlocks.ashwood_wood.get(), ModBlocks.ashwood_wood_stripped.get())
                    .put(ModBlocks.ashwood_log.get(), ModBlocks.ashwood_log_stripped.get()).build();

        });
        event.enqueueWork(() -> {

            ComposterBlock.CHANCES.put(ModItems.ash_leaves.get(), 0.35f);
        });
        WoodType.register(ModWoodTypes.ashwood);
        WoodType.register(ModWoodTypes.oak_log_variants);
        WoodType.register(ModWoodTypes.birch_log_variants);



    }
    private void doClientStuff(final FMLClientSetupEvent event){
        RenderTypeLookup.setRenderLayer(ModBlocks.ash_leaves.get(), RenderType.getCutout());
        RenderTypeLookup.setRenderLayer(ModBlocks.ash_trapdoor.get(), RenderType.getCutout());
        RenderTypeLookup.setRenderLayer(ModBlocks.ash_door.get(), RenderType.getCutout());

        RenderingRegistry.registerEntityRenderingHandler(ModEntityTypes.CROW.get(), CrowRender::new);

        Atlases.addWoodType(ModWoodTypes.ashwood);
        Atlases.addWoodType(ModWoodTypes.oak_log_variants);
        Atlases.addWoodType(ModWoodTypes.birch_log_variants);



    }



    private void enqueueIMC ( final InterModEnqueueEvent event)
        {
            InterModComms.sendTo("examplemod", "helloworld", () -> {
                LOGGER.info("Hello world from the MDK");
                return "Hello world";
            });
        }

        private void processIMC ( final InterModProcessEvent event)
        {
            LOGGER.info("Got IMC {}", event.getIMCStream().
                    map(m -> m.getMessageSupplier().get()).
                    collect(Collectors.toList()));
        }






        @SubscribeEvent
        public void onServerStarting (FMLServerStartingEvent event){
            LOGGER.info("HELLO from server starting");
        }

        @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD)
        public static class RegistryEvents {
            @SubscribeEvent
            public static void onBlocksRegistry(final RegistryEvent.Register<Block> blockRegistryEvent) {

    }

}}

 

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • For crash 1, set max-tick-time to -1 in your server.properties Crash 2 shows a conflict or incompatibility between LuckPerms and the mod boh-0.0.6.1-forge-1.20.1_2.jar
    • Add the crash-report or latest.log (logs-folder) with sites like https://mclo.gs/ and paste the link to it here  
    • so my minecraft crashes when opening my world, i played without any troubles for about 5 days and today it started tweaking.. pls help me
    • Hi guys! I am having some issues with the server crashing over and over and I was hoping to get some guidance.  Thanks in advance! Crash 1: java.lang.Error: ServerHangWatchdog detected that a single server tick took 60.00 seconds (should be max 0.05)     at net.minecraft.server.dedicated.ServerWatchdog.run(ServerWatchdog.java:43) ~[server-1.20.1-20230612.114412-srg.jar%23217!/:?] {re:classloading}     at java.lang.Thread.run(Thread.java:840) ~[?:?] { Crash 2: java.lang.IllegalStateException: Capability missing for eeb7f026-34b4-42f5-9164-e7736461df83     at me.lucko.luckperms.forge.capabilities.UserCapabilityImpl.lambda$get$0(UserCapabilityImpl.java:66) ~[?:?] {re:classloading,re:classloading,re:classloading}     at net.minecraftforge.common.util.LazyOptional.orElseThrow(LazyOptional.java:261) ~[forge-1.20.1-47.3.10-universal.jar%23222!/:?] {re:mixin,re:classloading}     at me.lucko.luckperms.forge.capabilities.UserCapabilityImpl.get(UserCapabilityImpl.java:66) ~[?:?] {re:classloading,re:classloading,re:classloading}     at me.lucko.luckperms.forge.util.BrigadierInjector$InjectedPermissionRequirement.test(BrigadierInjector.java:143) ~[?:?] {}     at me.lucko.luckperms.forge.util.BrigadierInjector$InjectedPermissionRequirement.test(BrigadierInjector.java:129) ~[?:?] {}     at com.mojang.brigadier.tree.CommandNode.canUse(CommandNode.java:65) ~[brigadier-1.1.8.jar%2376!/:?] {}     at com.mojang.brigadier.CommandDispatcher.parseNodes(CommandDispatcher.java:359) ~[brigadier-1.1.8.jar%2376!/:?] {}     at com.mojang.brigadier.CommandDispatcher.parse(CommandDispatcher.java:349) ~[brigadier-1.1.8.jar%2376!/:?] {}     at com.mojang.brigadier.CommandDispatcher.parse(CommandDispatcher.java:317) ~[brigadier-1.1.8.jar%2376!/:?] {}     at net.minecraft.commands.Commands.m_230957_(Commands.java:237) ~[server-1.20.1-20230612.114412-srg.jar%23217!/:?] {re:classloading}     at net.mcreator.boh.procedures.TeleportbenProcedure.lambda$execute$2(TeleportbenProcedure.java:65) ~[boh-0.0.6.1-forge-1.20.1_2.jar%23165!/:?] {re:classloading}     at net.mcreator.boh.BohMod.lambda$tick$2(BohMod.java:96) ~[boh-0.0.6.1-forge-1.20.1_2.jar%23165!/:?] {re:classloading}     at java.util.ArrayList.forEach(ArrayList.java:1511) ~[?:?] {re:mixin}     at net.mcreator.boh.BohMod.tick(BohMod.java:96) ~[boh-0.0.6.1-forge-1.20.1_2.jar%23165!/:?] {re:classloading}     at net.mcreator.boh.__BohMod_tick_ServerTickEvent.invoke(.dynamic) ~[boh-0.0.6.1-forge-1.20.1_2.jar%23165!/:?] {re:classloading,pl:eventbus:B}     at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:73) ~[eventbus-6.0.5.jar%2352!/:?] {}     at net.minecraftforge.eventbus.EventBus.post(EventBus.java:315) ~[eventbus-6.0.5.jar%2352!/:?] {}     at net.minecraftforge.eventbus.EventBus.post(EventBus.java:296) ~[eventbus-6.0.5.jar%2352!/:?] {}     at net.minecraftforge.event.ForgeEventFactory.onPostServerTick(ForgeEventFactory.java:950) ~[forge-1.20.1-47.3.10-universal.jar%23222!/:?] {re:classloading}     at net.minecraft.server.MinecraftServer.m_5705_(MinecraftServer.java:835) ~[server-1.20.1-20230612.114412-srg.jar%23217!/:?] {re:mixin,pl:accesstransformer:B,xf:fml:xaerominimap:xaero_minecraftserver,re:classloading,pl:accesstransformer:B,xf:fml:xaerominimap:xaero_minecraftserver,pl:mixin:A}     at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:661) ~[server-1.20.1-20230612.114412-srg.jar%23217!/:?] {re:mixin,pl:accesstransformer:B,xf:fml:xaerominimap:xaero_minecraftserver,re:classloading,pl:accesstransformer:B,xf:fml:xaerominimap:xaero_minecraftserver,pl:mixin:A}     at net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:251) ~[server-1.20.1-20230612.114412-srg.jar%23217!/:?] {re:mixin,pl:accesstransformer:B,xf:fml:xaerominimap:xaero_minecraftserver,re:classloading,pl:accesstransformer:B,xf:fml:xaerominimap:xaero_minecraftserver,pl:mixin:A}     at java.lang.Thread.run(Thread.java:840) ~[?:?] {}
    • Hello there! I am trying to make custom dimensions for a modpack I am making in an older minecraft version, 1.16.5. I like that version and it has a few other mods that have not been updated that I would still like to use. Anyway, I am having a terrible time with getting my dimension to work and have tried using code from other peoples projects to at least figure out what I'm supposed to be doing but it has not been as helpful as I would have liked. If anyone could help that would be greatly appreciated! Here is my github with all the code as I am using it: https://github.com/BladeColdsteel/InvigoratedDimensionsMod I have also included the last log, https://pastebin.com/zX9vsDSq, I had when I tried to load up a world, let me know if there is anything else I should send though, thank you!
  • Topics

×
×
  • Create New...

Important Information

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