Skip to content

Bug report [Forge / Fabric] #198

@AgentIllusion73

Description

@AgentIllusion73

Describe the bug

The GameProfile is null on NPC creation when certain other mods are present, such as Alex's Caves.

Platform(s)

Fabric

Environment(s)

Singleplayer

Versions

Minecraft 1.20.1
Taterzens 1.11.7

To Reproduce

Steps to reproduce the behavior:

  1. Download and install Forge 47.3.5.
  2. Download Forgified Fabric API. ([1.20.1] Forgified Fabric API 0.92.2+1.11.9+1.20.1)
  3. Download Sinytra Connector. (Connector 1.0.0-beta.46+1.20.1)
  4. Download and install Alex's Caves. (alexscaves-2.0.2)
  5. Download and install Taterzens. ([1.20.1] Taterzens 1.11.7)
  6. Start Minecraft with Forge client.
  7. Create new world with cheats enabled to access Taterzens commands.
  8. Once the world has loaded, type /npc create test. You should receive the "unexpected error" message.
  9. Check C:\Users<user>\AppData\Roaming.minecraft\logs\latest.txt for the message in the Logs section of this issue.

Expected behavior

Expected was the creation of an NPC.

Logs

Logs [26Jan2025 13:53:54.305] [Server thread/ERROR] [net.minecraftforge.eventbus.EventBus/EVENTBUS]: Exception caught during firing event: Cannot invoke "com.mojang.authlib.GameProfile.getId()" because "p_235876_" is null Index: 2 Listeners: 0: NORMAL 1: ASM: class com.github.alexthe666.alexsmobs.event.ServerEvents onEntityResize(Lnet/minecraftforge/event/entity/EntityEvent$Size;)V 2: ASM: com.github.alexmodguy.alexscaves.server.event.CommonEvents@553dfa17 resizeEntity(Lnet/minecraftforge/event/entity/EntityEvent$Size;)V 3: ASM: class com.simibubi.create.content.kinetics.deployer.DeployerFakePlayer deployerHasEyesOnHisFeet(Lnet/minecraftforge/event/entity/EntityEvent$Size;)V 4: ASM: noppes.npcs.ForgeEventHandler@76e1d4f6 forgeEntity(Lnet/minecraftforge/eventbus/api/Event;)V 5: ASM: com.talhanation.recruits.PillagerEvents@42713851 raidStartOnBurningOminous(Lnet/minecraftforge/event/entity/EntityEvent;)V 6: ASM: noppes.npcs.ForgeEventHandler@76e1d4f6 forgeEntity(Lnet/minecraftforge/eventbus/api/Event;)V java.lang.NullPointerException: Cannot invoke "com.mojang.authlib.GameProfile.getId()" because "p_235876_" is null at TRANSFORMER/minecraft@1.20.1/net.minecraft.core.UUIDUtil.m_235875_(UUIDUtil.java:98) at TRANSFORMER/minecraft@1.20.1/net.minecraft.world.entity.player.Player.(Player.java:178) at TRANSFORMER/minecraft@1.20.1/net.minecraft.server.level.ServerPlayer.(ServerPlayer.java:249) at TRANSFORMER/taterzens@1.11.7/org.samo_lego.taterzens.npc.TaterzenNPC.constructFakePlayer(TaterzenNPC.java:211) at TRANSFORMER/taterzens@1.11.7/org.samo_lego.taterzens.npc.TaterzenNPC.m_20088_(TaterzenNPC.java:418) at TRANSFORMER/alexscaves@2.0.2/com.github.alexmodguy.alexscaves.server.event.CommonEvents.resizeEntity(CommonEvents.java:107) at TRANSFORMER/alexscaves@2.0.2/com.github.alexmodguy.alexscaves.server.event.__CommonEvents_resizeEntity_Size.invoke(.dynamic) at MC-BOOTSTRAP/net.minecraftforge.eventbus/net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:73) at MC-BOOTSTRAP/net.minecraftforge.eventbus/net.minecraftforge.eventbus.EventBus.post(EventBus.java:315) at MC-BOOTSTRAP/net.minecraftforge.eventbus/net.minecraftforge.eventbus.EventBus.post(EventBus.java:296) at TRANSFORMER/forge@47.3.5/net.minecraftforge.event.ForgeEventFactory.getEntitySizeForge(ForgeEventFactory.java:799) at TRANSFORMER/minecraft@1.20.1/net.minecraft.world.entity.Entity.(Entity.java:261) at TRANSFORMER/minecraft@1.20.1/net.minecraft.world.entity.LivingEntity.(LivingEntity.java:233) at TRANSFORMER/minecraft@1.20.1/net.minecraft.world.entity.Mob.(Mob.java:123) at TRANSFORMER/minecraft@1.20.1/net.minecraft.world.entity.PathfinderMob.(PathfinderMob.java:14) at TRANSFORMER/taterzens@1.11.7/org.samo_lego.taterzens.npc.TaterzenNPC.(TaterzenNPC.java:160) at TRANSFORMER/taterzens@1.11.7/org.samo_lego.taterzens.npc.TaterzenNPC.(TaterzenNPC.java:146) at TRANSFORMER/taterzens@1.11.7/org.samo_lego.taterzens.api.TaterzensAPI.createTaterzen(TaterzensAPI.java:135) at TRANSFORMER/taterzens@1.11.7/org.samo_lego.taterzens.api.TaterzensAPI.createTaterzen(TaterzensAPI.java:154) at TRANSFORMER/taterzens@1.11.7/org.samo_lego.taterzens.commands.NpcCommand.spawnTaterzen(NpcCommand.java:401) at MC-BOOTSTRAP/brigadier@1.1.8/com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:264) at TRANSFORMER/minecraft@1.20.1/net.minecraft.commands.Commands.m_242674_(Commands.java:257) at TRANSFORMER/minecraft@1.20.1/net.minecraft.server.network.ServerGamePacketListenerImpl.m_246958_(ServerGamePacketListenerImpl.java:1244) at TRANSFORMER/minecraft@1.20.1/net.minecraft.server.network.ServerGamePacketListenerImpl.m_244885_(ServerGamePacketListenerImpl.java:1221) at TRANSFORMER/minecraft@1.20.1/net.minecraft.util.thread.BlockableEventLoop.m_18693_(BlockableEventLoop.java:67) at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) at TRANSFORMER/minecraft@1.20.1/net.minecraft.server.TickTask.run(TickTask.java:18) at TRANSFORMER/minecraft@1.20.1/net.minecraft.util.thread.BlockableEventLoop.m_6367_(BlockableEventLoop.java:156) at TRANSFORMER/minecraft@1.20.1/net.minecraft.util.thread.ReentrantBlockableEventLoop.m_6367_(ReentrantBlockableEventLoop.java:23) at TRANSFORMER/minecraft@1.20.1/net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:770) at TRANSFORMER/minecraft@1.20.1/net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:161) at TRANSFORMER/minecraft@1.20.1/net.minecraft.util.thread.BlockableEventLoop.m_7245_(BlockableEventLoop.java:130) at TRANSFORMER/minecraft@1.20.1/net.minecraft.server.MinecraftServer.m_129961_(MinecraftServer.java:753) at TRANSFORMER/minecraft@1.20.1/net.minecraft.server.MinecraftServer.m_7245_(MinecraftServer.java:747) at TRANSFORMER/minecraft@1.20.1/net.minecraft.util.thread.BlockableEventLoop.m_18699_(BlockableEventLoop.java:115) at TRANSFORMER/minecraft@1.20.1/net.minecraft.server.MinecraftServer.m_130012_(MinecraftServer.java:732) at TRANSFORMER/minecraft@1.20.1/net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:665) at TRANSFORMER/minecraft@1.20.1/net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:251) at java.base/java.lang.Thread.run(Thread.java:833)

Additional context
Using the source code provided with this project, I could create a new GameProfile object in the constructFakePlayer() method of TaterzenNPC.java before trying to create a new ServerPlayer object. This was an immediate resolution to the error I was getting; however, depending on the overall code structure, which I have not studied intensely, this could require more updates. Thank you for taking the time to look into this report.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions