Jump to content

Recommended Posts

Posted

I'm new at this minecraft mod thing, and i was trying to make custom entities. I got to make an pig and a zombie, but failed on making a slime.
I'm using the "GlobalEntityTypeAttributes#put" to define the Attributes of the entity, along with SlimeEntity#func_233666_p_ and SlimeEntity#func_233639_cI_ to get AttributeModifierMap.
But when i use the SlimeEntity#func_233666_p_ i get:

java.lang.IllegalArgumentException: Can't find attribute minecraft:generic.follow_range
	at net.minecraft.entity.ai.attributes.AttributeModifierMap.func_233810_d_(AttributeModifierMap.java:21) ~[forge-1.16.1-32.0.24_mapped_snapshot_20200514-1.16-recomp.jar:?]
	at net.minecraft.entity.ai.attributes.AttributeModifierMap.func_233804_a_(AttributeModifierMap.java:28) ~[forge-1.16.1-32.0.24_mapped_snapshot_20200514-1.16-recomp.jar:?]
	at net.minecraft.entity.ai.attributes.AttributeModifierManager.func_233795_c_(AttributeModifierManager.java:67) ~[forge-1.16.1-32.0.24_mapped_snapshot_20200514-1.16-recomp.jar:?]
	at net.minecraft.entity.LivingEntity.func_233637_b_(LivingEntity.java:1848) ~[forge-1.16.1-32.0.24_mapped_snapshot_20200514-1.16-recomp.jar:?]
	at net.minecraft.pathfinding.PathNavigator.<init>(PathNavigator.java:47) ~[forge-1.16.1-32.0.24_mapped_snapshot_20200514-1.16-recomp.jar:?]
	at net.minecraft.pathfinding.GroundPathNavigator.<init>(GroundPathNavigator.java:16) ~[forge-1.16.1-32.0.24_mapped_snapshot_20200514-1.16-recomp.jar:?]
	at net.minecraft.entity.MobEntity.createNavigator(MobEntity.java:135) ~[forge-1.16.1-32.0.24_mapped_snapshot_20200514-1.16-recomp.jar:?]
	at net.minecraft.entity.MobEntity.<init>(MobEntity.java:114) ~[forge-1.16.1-32.0.24_mapped_snapshot_20200514-1.16-recomp.jar:?]
	at net.minecraft.entity.monster.SlimeEntity.<init>(SlimeEntity.java:54) ~[forge-1.16.1-32.0.24_mapped_snapshot_20200514-1.16-recomp.jar:?]
	at net.ddns.samjviana.morethings.entity.BlueSlimeEntity.<init>(BlueSlimeEntity.java:9) ~[main/:?]
	at net.minecraft.entity.EntityType.create(EntityType.java:442) ~[forge-1.16.1-32.0.24_mapped_snapshot_20200514-1.16-recomp.jar:?]
	at net.minecraft.entity.EntityType.lambda$loadEntityUnchecked$1(EntityType.java:453) ~[forge-1.16.1-32.0.24_mapped_snapshot_20200514-1.16-recomp.jar:?]
	at java.util.Optional.map(Optional.java:215) ~[?:1.8.0_221]
	at net.minecraft.entity.EntityType.loadEntityUnchecked(EntityType.java:452) ~[forge-1.16.1-32.0.24_mapped_snapshot_20200514-1.16-recomp.jar:?]
	at net.minecraft.entity.EntityType.loadEntity(EntityType.java:510) ~[forge-1.16.1-32.0.24_mapped_snapshot_20200514-1.16-recomp.jar:?]
	at net.minecraft.entity.EntityType.func_220335_a(EntityType.java:492) ~[forge-1.16.1-32.0.24_mapped_snapshot_20200514-1.16-recomp.jar:?]
	at net.minecraft.command.impl.SummonCommand.summonEntity(SummonCommand.java:49) ~[forge-1.16.1-32.0.24_mapped_snapshot_20200514-1.16-recomp.jar:?]
	at net.minecraft.command.impl.SummonCommand.lambda$register$1(SummonCommand.java:33) ~[forge-1.16.1-32.0.24_mapped_snapshot_20200514-1.16-recomp.jar:?]
	at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:262) ~[brigadier-1.0.17.jar:?]
	at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:176) ~[brigadier-1.0.17.jar:?]
	at net.minecraft.command.Commands.handleCommand(Commands.java:218) ~[?:?]
	at net.minecraft.network.play.ServerPlayNetHandler.handleSlashCommand(ServerPlayNetHandler.java:1085) ~[?:?]
	at net.minecraft.network.play.ServerPlayNetHandler.processChatMessage(ServerPlayNetHandler.java:1065) ~[?:?]
	at net.minecraft.network.play.client.CChatMessagePacket.processPacket(CChatMessagePacket.java:40) ~[?:?]
	at net.minecraft.network.play.client.CChatMessagePacket.processPacket(CChatMessagePacket.java:8) ~[?:?]
	at net.minecraft.network.PacketThreadUtil.lambda$checkThreadAndEnqueue$0(PacketThreadUtil.java:19) ~[?:?]
	at net.minecraft.util.concurrent.TickDelayedTask.run(TickDelayedTask.java:20) ~[?:?]
	at net.minecraft.util.concurrent.ThreadTaskExecutor.run(ThreadTaskExecutor.java:139) ~[?:?]
	at net.minecraft.util.concurrent.RecursiveEventLoop.run(RecursiveEventLoop.java:22) ~[?:?]
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:763) ~[?:?]
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:157) ~[?:?]
	at net.minecraft.util.concurrent.ThreadTaskExecutor.driveOne(ThreadTaskExecutor.java:109) ~[?:?]
	at net.minecraft.server.MinecraftServer.driveOneInternal(MinecraftServer.java:746) ~[?:?]
	at net.minecraft.server.MinecraftServer.driveOne(MinecraftServer.java:740) ~[?:?]
	at net.minecraft.util.concurrent.ThreadTaskExecutor.driveUntil(ThreadTaskExecutor.java:122) ~[?:?]
	at net.minecraft.server.MinecraftServer.runScheduledTasks(MinecraftServer.java:726) ~[?:?]
	at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:669) ~[?:?]
	at net.minecraft.server.MinecraftServer.lambda$func_240784_a_$0(MinecraftServer.java:231) ~[?:?]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_221]

 

And with SlimeEntity#func_233639_cI_ i get:
 

net.minecraft.crash.ReportedException: Loading entity NBT
	at net.minecraft.entity.Entity.read(Entity.java:1660) ~[forge-1.16.1-32.0.24_mapped_snapshot_20200514-1.16-recomp.jar:?]
	at net.minecraft.entity.EntityType.lambda$loadEntityUnchecked$2(EntityType.java:455) ~[forge-1.16.1-32.0.24_mapped_snapshot_20200514-1.16-recomp.jar:?]
	at net.minecraft.util.Util.acceptOrElse(Util.java:319) ~[forge-1.16.1-32.0.24_mapped_snapshot_20200514-1.16-recomp.jar:?]
	at net.minecraft.entity.EntityType.loadEntityUnchecked(EntityType.java:452) ~[forge-1.16.1-32.0.24_mapped_snapshot_20200514-1.16-recomp.jar:?]
	at net.minecraft.entity.EntityType.loadEntity(EntityType.java:510) ~[forge-1.16.1-32.0.24_mapped_snapshot_20200514-1.16-recomp.jar:?]
	at net.minecraft.entity.EntityType.func_220335_a(EntityType.java:492) ~[forge-1.16.1-32.0.24_mapped_snapshot_20200514-1.16-recomp.jar:?]
	at net.minecraft.command.impl.SummonCommand.summonEntity(SummonCommand.java:49) ~[forge-1.16.1-32.0.24_mapped_snapshot_20200514-1.16-recomp.jar:?]
	at net.minecraft.command.impl.SummonCommand.lambda$register$1(SummonCommand.java:33) ~[forge-1.16.1-32.0.24_mapped_snapshot_20200514-1.16-recomp.jar:?]
	at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:262) ~[brigadier-1.0.17.jar:?]
	at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:176) ~[brigadier-1.0.17.jar:?]
	at net.minecraft.command.Commands.handleCommand(Commands.java:218) ~[?:?]
	at net.minecraft.network.play.ServerPlayNetHandler.handleSlashCommand(ServerPlayNetHandler.java:1085) ~[?:?]
	at net.minecraft.network.play.ServerPlayNetHandler.processChatMessage(ServerPlayNetHandler.java:1065) ~[?:?]
	at net.minecraft.network.play.client.CChatMessagePacket.processPacket(CChatMessagePacket.java:40) ~[?:?]
	at net.minecraft.network.play.client.CChatMessagePacket.processPacket(CChatMessagePacket.java:8) ~[?:?]
	at net.minecraft.network.PacketThreadUtil.lambda$checkThreadAndEnqueue$0(PacketThreadUtil.java:19) ~[?:?]
	at net.minecraft.util.concurrent.TickDelayedTask.run(TickDelayedTask.java:20) ~[?:?]
	at net.minecraft.util.concurrent.ThreadTaskExecutor.run(ThreadTaskExecutor.java:139) ~[?:?]
	at net.minecraft.util.concurrent.RecursiveEventLoop.run(RecursiveEventLoop.java:22) ~[?:?]
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:763) ~[?:?]
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:157) ~[?:?]
	at net.minecraft.util.concurrent.ThreadTaskExecutor.driveOne(ThreadTaskExecutor.java:109) ~[?:?]
	at net.minecraft.server.MinecraftServer.driveOneInternal(MinecraftServer.java:746) ~[?:?]
	at net.minecraft.server.MinecraftServer.driveOne(MinecraftServer.java:740) ~[?:?]
	at net.minecraft.util.concurrent.ThreadTaskExecutor.drainTasks(ThreadTaskExecutor.java:97) ~[?:?]
	at net.minecraft.server.MinecraftServer.runScheduledTasks(MinecraftServer.java:725) ~[?:?]
	at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:669) ~[?:?]
	at net.minecraft.server.MinecraftServer.lambda$func_240784_a_$0(MinecraftServer.java:231) ~[?:?]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_221]
Caused by: java.lang.NullPointerException
	at net.minecraft.entity.monster.SlimeEntity.setSlimeSize(SlimeEntity.java:80) ~[forge-1.16.1-32.0.24_mapped_snapshot_20200514-1.16-recomp.jar:?]
	at net.minecraft.entity.monster.SlimeEntity.readAdditional(SlimeEntity.java:110) ~[forge-1.16.1-32.0.24_mapped_snapshot_20200514-1.16-recomp.jar:?]
	at net.minecraft.entity.Entity.read(Entity.java:1645) ~[forge-1.16.1-32.0.24_mapped_snapshot_20200514-1.16-recomp.jar:?]
	... 28 more

 

Posted

It would be good if you could show your code, that might help find the issue.

 

My guess is you didn't register MobEntity#func_233666_p_ in your FMLCommonSetupEvent for your specific entity type as that does initialize the follow range attribute with a value of 16.

Posted

Actually your answer in the topic 1.16.1 Custom Entity attributes helped me a lot understanding how to work with AttributeModifierMap, and i managed to finish the entity, thank you.
Now i'm trying to change the color of the slime. instead of having a bunch of entities i want an "template" that randomize in many colors (just like it happens with leaves), so i'll have slimes of many colors, i know it's not an original idea but it's just for practice. Should i open another topic about this?
Sorry by the english by the way XD.

  • samjviana changed the title to [SOLVED]-[1.16.1] How to create an custom slime entity

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.