Jump to content

Recommended Posts

Posted

"How to make an aquatic mob in Forge 1.21.1"

Hi! I'm working on a custom turtle mob for my mod using Minecraft Forge 1.21.1, and I'm having some trouble with its swimming behavior.

I want the turtle to swim properly, like a real turtle — moving freely through water and avoiding the sea floor so it doesn’t get stuck between blocks. Right now, it either sinks too much, swims awkwardly, or keeps bumping into the bottom.

Any advice on how to handle pathfinding, movement control, or AI goals for aquatic mobs? Maybe examples from existing mods or vanilla code?

Thanks in advance!

Posted

You should be able to browse the Minecraft source through your IDE to look at existing vanilla mobs. Been a few since I've look at much MC, so not sure what mobs would be good examples, but I know they have at least fish lol. :)

For instance, in Eclipse, on the left side where it shows your source packages/files, there's a section for 'Referenced Libraries'. Expanding that, there's a list of jars that are used in the project. The project I'm looking at, there's one for "forge-1.20.4-49.0.38_mapped_parchment_2024.02.25-1.20.4-recomp.jar". Dropping that down shows a big list of packages, including the net.minecraft.* packages, and dropping those down show the classes included, which can be clicked on to view the source.

If you use IntelliJ, it's more or less the same thing, look around for the Referenced Libraries, and find the forge one, boom, Bob's your uncle. :)) 

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.