Jump to content

Unable to summon entity


Yal

Recommended Posts

I am making a mod and I am new so I am using this tutorial by kaupenjoe: Forge Modding Tutorials - Minecraft 1.20.X - YouTube. I made a monster called the mine creeper but it doesn't work. Whenever I tried to summon it the error message Unable to summon entity appeared. When I checked the log it said this.

[19:25:28] [Render thread/INFO] [minecraft/ChatComponent]: [System] [CHAT] Unable to summon entity
[19:25:29] [Server thread/WARN] [minecraft/EntityType]: Exception loading entity: 
java.lang.NullPointerException: Cannot invoke "net.minecraft.network.syncher.EntityDataAccessor.getId()" because "pKey" is null
    at net.minecraft.network.syncher.SynchedEntityData.define(SynchedEntityData.java:78) ~[forge-1.20.1-47.0.19_mapped_parchment_2023.06.26-1.20.1.jar%23189!/:?] {re:classloading}
    at net.yal.yalmod.entity.custom.MineCreeperEntity.defineSynchedData(MineCreeperEntity.java:90) ~[%23194!/:?] {re:classloading}
    at net.minecraft.world.entity.Entity.<init>(Entity.java:260) ~[forge-1.20.1-47.0.19_mapped_parchment_2023.06.26-1.20.1.jar%23189!/:?] {re:classloading,pl:accesstransformer:B}
    at net.minecraft.world.entity.LivingEntity.<init>(LivingEntity.java:233) ~[forge-1.20.1-47.0.19_mapped_parchment_2023.06.26-1.20.1.jar%23189!/:?] {re:classloading}
    at net.minecraft.world.entity.Mob.<init>(Mob.java:123) ~[forge-1.20.1-47.0.19_mapped_parchment_2023.06.26-1.20.1.jar%23189!/:?] {re:classloading,pl:accesstransformer:B}
    at net.minecraft.world.entity.PathfinderMob.<init>(PathfinderMob.java:14) ~[forge-1.20.1-47.0.19_mapped_parchment_2023.06.26-1.20.1.jar%23189!/:?] {re:classloading}
    at net.minecraft.world.entity.monster.Monster.<init>(Monster.java:31) ~[forge-1.20.1-47.0.19_mapped_parchment_2023.06.26-1.20.1.jar%23189!/:?] {re:classloading}
    at net.yal.yalmod.entity.custom.MineCreeperEntity.<init>(MineCreeperEntity.java:45) ~[%23194!/:?] {re:classloading}
    at net.minecraft.world.entity.EntityType.create(EntityType.java:525) ~[forge-1.20.1-47.0.19_mapped_parchment_2023.06.26-1.20.1.jar%23189!/:?] {re:classloading,xf:fml:forge:forge_method_redirector}
    at net.minecraft.world.entity.EntityType.lambda$create$4(EntityType.java:530) ~[forge-1.20.1-47.0.19_mapped_parchment_2023.06.26-1.20.1.jar%23189!/:?] {re:classloading,xf:fml:forge:forge_method_redirector}
    at java.util.Optional.map(Optional.java:260) ~[?:?] {}
    at net.minecraft.world.entity.EntityType.create(EntityType.java:529) ~[forge-1.20.1-47.0.19_mapped_parchment_2023.06.26-1.20.1.jar%23189!/:?] {re:classloading,xf:fml:forge:forge_method_redirector}
    at net.minecraft.world.entity.EntityType.loadStaticEntity(EntityType.java:607) ~[forge-1.20.1-47.0.19_mapped_parchment_2023.06.26-1.20.1.jar%23189!/:?] {re:classloading,xf:fml:forge:forge_method_redirector}
    at net.minecraft.world.entity.EntityType.loadEntityRecursive(EntityType.java:563) ~[forge-1.20.1-47.0.19_mapped_parchment_2023.06.26-1.20.1.jar%23189!/:?] {re:classloading,xf:fml:forge:forge_method_redirector}
    at net.minecraft.server.commands.SummonCommand.createEntity(SummonCommand.java:67) ~[forge-1.20.1-47.0.19_mapped_parchment_2023.06.26-1.20.1.jar%23189!/:?] {re:classloading,xf:fml:forge:forge_method_redirector}
    at net.minecraft.server.commands.SummonCommand.spawnEntity(SummonCommand.java:86) ~[forge-1.20.1-47.0.19_mapped_parchment_2023.06.26-1.20.1.jar%23189!/:?] {re:classloading,xf:fml:forge:forge_method_redirector}
    at net.minecraft.server.commands.SummonCommand.lambda$register$1(SummonCommand.java:44) ~[forge-1.20.1-47.0.19_mapped_parchment_2023.06.26-1.20.1.jar%23189!/:?] {re:classloading,xf:fml:forge:forge_method_redirector}
    at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:264) ~[brigadier-1.1.8.jar%23134!/:?] {}
    at net.minecraft.commands.Commands.performCommand(Commands.java:257) ~[forge-1.20.1-47.0.19_mapped_parchment_2023.06.26-1.20.1.jar%23189!/:?] {re:classloading}
    at net.minecraft.server.network.ServerGamePacketListenerImpl.performChatCommand(ServerGamePacketListenerImpl.java:1244) ~[forge-1.20.1-47.0.19_mapped_parchment_2023.06.26-1.20.1.jar%23189!/:?] {re:classloading,pl:accesstransformer:B}
    at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChatCommand$11(ServerGamePacketListenerImpl.java:1221) ~[forge-1.20.1-47.0.19_mapped_parchment_2023.06.26-1.20.1.jar%23189!/:?] {re:classloading,pl:accesstransformer:B}
    at net.minecraft.util.thread.BlockableEventLoop.lambda$submitAsync$0(BlockableEventLoop.java:67) ~[forge-1.20.1-47.0.19_mapped_parchment_2023.06.26-1.20.1.jar%23189!/:?] {re:classloading,pl:accesstransformer:B}
    at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?] {}
    at net.minecraft.server.TickTask.run(TickTask.java:18) ~[forge-1.20.1-47.0.19_mapped_parchment_2023.06.26-1.20.1.jar%23189!/:?] {re:classloading}
    at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:156) ~[forge-1.20.1-47.0.19_mapped_parchment_2023.06.26-1.20.1.jar%23189!/:?] {re:classloading,pl:accesstransformer:B}
    at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:23) ~[forge-1.20.1-47.0.19_mapped_parchment_2023.06.26-1.20.1.jar%23189!/:?] {re:classloading}
    at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:772) ~[forge-1.20.1-47.0.19_mapped_parchment_2023.06.26-1.20.1.jar%23189!/:?] {re:classloading,pl:accesstransformer:B}
    at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:161) ~[forge-1.20.1-47.0.19_mapped_parchment_2023.06.26-1.20.1.jar%23189!/:?] {re:classloading,pl:accesstransformer:B}
    at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:130) ~[forge-1.20.1-47.0.19_mapped_parchment_2023.06.26-1.20.1.jar%23189!/:?] {re:classloading,pl:accesstransformer:B}
    at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:755) ~[forge-1.20.1-47.0.19_mapped_parchment_2023.06.26-1.20.1.jar%23189!/:?] {re:classloading,pl:accesstransformer:B}
    at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:749) ~[forge-1.20.1-47.0.19_mapped_parchment_2023.06.26-1.20.1.jar%23189!/:?] {re:classloading,pl:accesstransformer:B}
    at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:139) ~[forge-1.20.1-47.0.19_mapped_parchment_2023.06.26-1.20.1.jar%23189!/:?] {re:classloading,pl:accesstransformer:B}
    at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:735) ~[forge-1.20.1-47.0.19_mapped_parchment_2023.06.26-1.20.1.jar%23189!/:?] {re:classloading,pl:accesstransformer:B}
    at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:667) ~[forge-1.20.1-47.0.19_mapped_parchment_2023.06.26-1.20.1.jar%23189!/:?] {re:classloading,pl:accesstransformer:B}
    at net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:251) ~[forge-1.20.1-47.0.19_mapped_parchment_2023.06.26-1.20.1.jar%23189!/:?] {re:classloading,pl:accesstransformer:B}
    at java.lang.Thread.run(Thread.java:840) ~[?:?] {}

Link to comment
Share on other sites

This is my attributes line, my mob is a monster

public static AttributeSupplier.Builder createAttributes() { return Monster.createMonsterAttributes().add(Attributes.MAX_HEALTH, 8.0).add(Attributes.MOVEMENT_SPEED, 0.0).add(Attributes.ATTACK_DAMAGE, 0.0 ).add(Attributes.FOLLOW_RANGE, 10.0); }

Link to comment
Share on other sites

Updated it.

public static AttributeSupplier.Builder createAttributes() {

return Monster.createMonsterAttributes()

.add(Attributes.MAX_HEALTH, 8.0)

.add(Attributes.MOVEMENT_SPEED, 0.0)

.add(Attributes.ATTACK_DAMAGE, 0.0 )

.add(Attributes.FOLLOW_RANGE, 10.0)

.add(Attributes.ARMOR, 0)

.add(Attributes.ARMOR_TOUGHNESS, 0);

}

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.



×
×
  • Create New...

Important Information

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