• 0

    posted a message on [Unsolved] [1.16.5] Java.lang.NullPointerExeption: Registry Object not present: lewdcraft:orangefoxgirl

    My Entity refuses to launch and i am using geckolib. However no official tutorials or support are available for the 1.16.5 version. However my mod needs to be in 1.16.5 and uses it as a dependency. So with nothing to go on i decided to turn to the Forge Forums in hope of someone knowing even the slightest bit about how to fix my problem. Nobody knows anything there so i turned to the Minecraft Forums.


    My Main Class:

    package com.virtualfantasystudios.lewdcraft;


    import org.apache.logging.log4j.LogManager;

    import org.apache.logging.log4j.Logger;


    import com.virtualfantasystudios.lewdcraft.core.init.ItemInit;

    import com.virtualfantasystudios.lewdcraft.entity.EntityInit;

    import com.virtualfantasystudios.lewdcraft.entity.client.girls.OrangeFoxGirlRenderer;


    import net.minecraftforge.common.MinecraftForge;

    import net.minecraftforge.eventbus.api.IEventBus;

    import net.minecraftforge.fml.client.registry.RenderingRegistry;

    import net.minecraftforge.fml.common.Mod;

    import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;

    import software.bernie.geckolib3.GeckoLib;


    @Mod("lewdcraft")

    public class Lewdcraft {

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

    public static final String MOD_ID = "lewdcraft";


    public Lewdcraft() {

    IEventBus bus = FMLJavaModLoadingContext.get().getModEventBus();

    ItemInit.ITEMS.register(bus);

    EntityInit.ENTITIES.register(bus);

    GeckoLib.initialize();

    RenderingRegistry.registerEntityRenderingHandler(EntityInit.ORANGEFOXGIRL.get(), OrangeFoxGirlRenderer::new);

    MinecraftForge.EVENT_BUS.register(this);

    }

    }





    My Entity Model Class:

    package com.virtualfantasystudios.lewdcraft.entity.client.girls;


    import com.virtualfantasystudios.lewdcraft.Lewdcraft;

    import com.virtualfantasystudios.lewdcraft.entity.girls.OrangeFoxGirl;

    import net.minecraft.util.ResourceLocation;

    import software.bernie.geckolib3.model.AnimatedGeoModel;


    public class OrangeFoxGirlModel extends AnimatedGeoModel<OrangeFoxGirl> {

    @Override

    public ResourceLocation getModelLocation(OrangeFoxGirl object) {

    return new ResourceLocation(Lewdcraft.MOD_ID, "entity/girls/geo/orangefoxgirl.geo.json");

    }


    @Override

    public ResourceLocation getTextureLocation(OrangeFoxGirl object) {

    return new ResourceLocation(Lewdcraft.MOD_ID, "entity/girls/textures/orangefoxgirl.png");

    }

    @Override

    public ResourceLocation getAnimationFileLocation(OrangeFoxGirl animatable) {

    return new ResourceLocation(Lewdcraft.MOD_ID, "entity/girls/animations/orangefoxgirl.animation.json");

    }

    }






    My Entity Renderer Class:

    package com.virtualfantasystudios.lewdcraft.entity.client.girls;


    import com.mojang.blaze3d.matrix.MatrixStack;

    import com.mojang.blaze3d.vertex.IVertexBuilder;

    import com.virtualfantasystudios.lewdcraft.Lewdcraft;

    import com.virtualfantasystudios.lewdcraft.entity.girls.OrangeFoxGirl;


    import net.minecraft.client.renderer.IRenderTypeBuffer;

    import net.minecraft.client.renderer.RenderType;

    import net.minecraft.client.renderer.entity.EntityRendererManager;

    import net.minecraft.util.ResourceLocation;

    import software.bernie.geckolib3.renderers.geo.GeoEntityRenderer;


    public class OrangeFoxGirlRenderer extends GeoEntityRenderer<OrangeFoxGirl>{


    public OrangeFoxGirlRenderer(EntityRendererManager renderManager) {

    super(renderManager, new OrangeFoxGirlModel());

    this.shadowRadius = 0.3f;

    }

    @Override

    public ResourceLocation getTextureLocation(OrangeFoxGirl instance) {

    return new ResourceLocation(Lewdcraft.MOD_ID, "entity/girls/textures/orangefoxgirl.png");

    }

    @Override

    public RenderType getRenderType(OrangeFoxGirl animatable, float partialTicks, MatrixStack stack,

    IRenderTypeBuffer renderTypeBuffer,

    IVertexBuilder vertexBuilder, int packedLightIn,

    ResourceLocation textureLocation) {

    stack.scale(0.8f, 0.8f, 0.8f);

    return super.getRenderType(animatable, partialTicks, stack, renderTypeBuffer, vertexBuilder, packedLightIn,textureLocation);

    }

    }





    My Entity Class:

    package com.virtualfantasystudios.lewdcraft.entity.girls;


    import net.minecraft.block.BlockState;

    import net.minecraft.entity.EntityType;

    import net.minecraft.entity.ai.attributes.AttributeModifierMap;

    import net.minecraft.entity.ai.attributes.Attributes;

    import net.minecraft.entity.monster.MonsterEntity;

    import net.minecraft.util.DamageSource;

    import net.minecraft.util.SoundEvent;

    import net.minecraft.util.SoundEvents;

    import net.minecraft.util.math.BlockPos;

    import net.minecraft.world.World;

    import software.bernie.geckolib3.core.IAnimatable;

    import software.bernie.geckolib3.core.PlayState;

    import software.bernie.geckolib3.core.builder.AnimationBuilder;

    import software.bernie.geckolib3.core.controller.AnimationController;

    import software.bernie.geckolib3.core.event.predicate.AnimationEvent;

    import software.bernie.geckolib3.core.manager.AnimationData;

    import software.bernie.geckolib3.core.manager.AnimationFactory;


    public class OrangeFoxGirl extends MonsterEntity implements IAnimatable {

    private AnimationFactory factory = new AnimationFactory(this);


    public OrangeFoxGirl(EntityType<? extends MonsterEntity> entityType, World worldIn) {

    super(entityType, worldIn);

    }


    public static AttributeModifierMap setAttributes() {

    return MonsterEntity.createMobAttributes()

    .add(Attributes.MAX_HEALTH, 20.0D)

    .add(Attributes.ATTACK_DAMAGE, 3.0f)

    .add(Attributes.ATTACK_SPEED, 1.0f)

    .add(Attributes.MOVEMENT_SPEED, 0.4f).build();

    }


    private <E extends IAnimatable> PlayState predicate(AnimationEvent<E> event) {

    if (event.isMoving()) {

    event.getController()

    .setAnimation(new AnimationBuilder().addRepeatingAnimation("animation.redfoxgirl.walk", 0));

    return PlayState.CONTINUE;

    }


    event.getController().setAnimation(new AnimationBuilder().addAnimation("animation.redfoxgirl.idle"));

    return PlayState.CONTINUE;

    }


    @Override

    public void registerControllers(AnimationData data) {

    data.addAnimationController(new AnimationController<IAnimatable>(this, "controller", 0, this::predicate));

    }


    @Override

    public AnimationFactory getFactory() {

    return factory;

    }

    protected void playStepSound(BlockPos pos, BlockState blockIn) {

    this.playSound(SoundEvents.SWEET_BERRY_BUSH_PICK_BERRIES, 0.15F, 1.0F);

    }

    protected SoundEvent getAmbientSound() { return SoundEvents.CAT_STRAY_AMBIENT; }

    protected SoundEvent getHurtSound(DamageSource damageSourceIn) { return SoundEvents.DOLPHIN_HURT; }

    protected SoundEvent getDeathSound() { return SoundEvents.DOLPHIN_DEATH; }

    protected float getSoundVolume() { return 0.2F; }

    }







    My Entity Init class:

    package com.virtualfantasystudios.lewdcraft.entity;


    import com.virtualfantasystudios.lewdcraft.Lewdcraft;

    import com.virtualfantasystudios.lewdcraft.entity.girls.OrangeFoxGirl;


    import net.minecraft.entity.EntityClassification;

    import net.minecraft.entity.EntityType;

    import net.minecraft.util.ResourceLocation;

    import net.minecraftforge.eventbus.api.IEventBus;

    import net.minecraftforge.fml.RegistryObject;

    import net.minecraftforge.registries.DeferredRegister;

    import net.minecraftforge.registries.ForgeRegistries;


    public class EntityInit {

    public static final DeferredRegister<EntityType<?>> ENTITIES =

    DeferredRegister.create(ForgeRegistries.ENTITIES, Lewdcraft.MOD_ID);

    //Girls

    public static final RegistryObject<EntityType<OrangeFoxGirl>> ORANGEFOXGIRL =

    ENTITIES.register("orangefoxgirl",

    () -> EntityType.Builder.of(OrangeFoxGirl::new, EntityClassification.MISC)

    .sized(8.5f, 1.5f)

    .build(new ResourceLocation(Lewdcraft.MOD_ID, "orangefoxgirl").toString()));

    //Boys

    public static void register(IEventBus eventBus) {

    ENTITIES.register(eventBus);

    }

    }







    My Crash Report:

    ---- Minecraft Crash Report ----
    // You should try our sister game, Minceraft!

    Time: 11/26/23, 5:24 PM
    Description: Mod loading error has occurred

    java.lang.Exception: Mod Loading has failed
    at net.minecraftforge.fml.CrashReportExtender.dumpModLoadingCrashReport(CrashReportExtender.java:71) ~[forge-1.16.5-36.2.39_mapped_official_1.16.5-recomp.jar:?] {re:classloading}
    at net.minecraftforge.fml.client.ClientModLoader.completeModLoading(ClientModLoader.java:174) ~[forge-1.16.5-36.2.39_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.lambda$null$1(Minecraft.java:508) ~[forge-1.16.5-36.2.39_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.util.Util.ifElse(Util.java:320) ~[forge-1.16.5-36.2.39_mapped_official_1.16.5-recomp.jar:?] {re:classloading}
    at net.minecraft.client.Minecraft.lambda$new$2(Minecraft.java:504) ~[forge-1.16.5-36.2.39_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.gui.ResourceLoadProgressGui.render(ResourceLoadProgressGui.java:113) ~[forge-1.16.5-36.2.39_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraft.client.renderer.GameRenderer.render(GameRenderer.java:481) ~[forge-1.16.5-36.2.39_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.runTick(Minecraft.java:977) ~[forge-1.16.5-36.2.39_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.run(Minecraft.java:607) ~[forge-1.16.5-36.2.39_mapped_official_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.39_mapped_official_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:77) ~[?:?] {}
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}
    at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] {}
    at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:38) ~[forge-1.16.5-36.2.39_mapped_official_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.39_mapped_official_1.16.5-recomp.jar:?] {}

    A detailed walkthrough of the error, its code path and all known details is as follows:
    ---------------------------------------------------------------------------------------

    -- Head --
    Thread: Render thread
    Stacktrace:
    at java.util.Objects.requireNonNull(Objects.java:336) ~[?:?] {}
    -- MOD lewdcraft --
    Details:
    Mod File: main
    Failure message: LewdCraft (lewdcraft) has failed to load correctly
    java.lang.NullPointerException: Registry Object not present: lewdcraft:orangefoxgirl
    Mod Version: 0.5
    Mod Issue URL: NOT PROVIDED
    Exception message: java.lang.NullPointerException: Registry Object not present: lewdcraft:orangefoxgirl
    Stacktrace:
    at java.util.Objects.requireNonNull(Objects.java:336) ~[?:?] {}
    at net.minecraftforge.fml.RegistryObject.get(RegistryObject.java:106) ~[forge:?] {re:classloading}
    at com.virtualfantasystudios.lewdcraft.Lewdcraft.<init>(Lewdcraft.java:33) ~[?:?] {re:classloading}
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?] {re:classloading,re:classloading}
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) ~[?:?] {re:classloading,re:classloading}
    at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?] {re:classloading,re:classloading}
    at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?] {}
    at java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128) ~[?:?] {}
    at jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:347) ~[?:?] {re:classloading,re:classloading}
    at java.lang.Class.newInstance(Class.java:645) ~[?:?] {}
    at net.minecraftforge.fml.javafmlmod.FMLModContainer.constructMod(FMLModContainer.java:67) ~[forge:?] {re:classloading}
    at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$4(ModContainer.java:106) ~[forge:?] {re:classloading}
    at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804) ~[?:?] {}
    at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796) ~[?:?] {}
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[?:?] {}
    at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[?:?] {}
    at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[?:?] {}
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[?:?] {}
    at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[?:?] {}

    -- System Details --
    Details:
    Minecraft Version: 1.16.5
    Minecraft Version ID: 1.16.5
    Operating System: Windows 10 (amd64) version 10.0
    Java Version: 17.0.7, Eclipse Adoptium
    Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Eclipse Adoptium
    Memory: 1154366864 bytes (1100 MB) / 1556086784 bytes (1484 MB) up to 4282384384 bytes (4084 MB)
    CPUs: 16
    JVM Flags: 3 total; -XX:+IgnoreUnrecognizedVMOptions -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -XX:+ShowCodeDetailsInExceptionMessages
    ModLauncher: 8.1.3+8.1.3+main-8.1.x.c94d18ec
    ModLauncher launch target: fmluserdevclient
    ModLauncher naming: mcp
    ModLauncher services:
    /mixin-0.8.4.jar mixin PLUGINSERVICE
    /eventbus-4.0.0.jar eventbus PLUGINSERVICE
    /forge-1.16.5-36.2.39_mapped_official_1.16.5-launcher.jar object_holder_definalize PLUGINSERVICE
    /forge-1.16.5-36.2.39_mapped_official_1.16.5-launcher.jar runtime_enum_extender PLUGINSERVICE
    /forge-1.16.5-36.2.39_mapped_official_1.16.5-launcher.jar capability_inject_definalize PLUGINSERVICE
    /accesstransformers-3.0.1.jar accesstransformer PLUGINSERVICE
    /forge-1.16.5-36.2.39_mapped_official_1.16.5-launcher.jar runtimedistcleaner PLUGINSERVICE
    /mixin-0.8.4.jar mixin TRANSFORMATIONSERVICE
    /forge-1.16.5-36.2.39_mapped_official_1.16.5-launcher.jar fml TRANSFORMATIONSERVICE
    FML: 36.2
    Forge: net.minecraftforge:36.2.39
    FML Language Providers:
    [email protected]
    minecraft@1
    Mod List:
    client-extra.jar |Minecraft |minecraft |1.16.5 |CREATE_REG|Manifest: a1:d4:5e:04:4f:d3:d6:e0:7b:37:97:cf:77:b0:de:ad:4a:47:ce:8c:96:49:5f:0a:cf:8c:ae:b2:6d:4b:8a:3f
    main |LewdCraft |lewdcraft |0.5 |ERROR |Manifest: NOSIGNATURE
    forge-1.16.5-36.2.39_mapped_official_1.16.5-recomp|Forge |forge |36.2.39 |CREATE_REG|Manifest: NOSIGNATURE
    geckolib-forge-1.16.5-3.0.97_mapped_official_1.16.|GeckoLib |geckolib3 |3.0.97 |CREATE_REG|Manifest: NOSIGNATURE
    Crash Report UUID: bebb0b82-351c-4d21-ba61-d986b5ba4e4b

    Posted in: Modification Development
  • To post a comment, please .