How to make a mob walk on land and swim in the water

Started by Cosmic_Mango33 on

Topic category: Advanced modding

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make a mob walk on land and swim in the water

I've added a capybara to my mod and I'm trying to get it to swim when in the water, but it only sits still and sinks while playing its swimming animation. When on land, it moves just find and when following an item it moves both in water and on land, but I can't get the mob to swim randomly while in the water, even with the "swim randomly" block inserted.

Joined Aug 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
have both wander around and…
Sun, 12/11/2022 - 17:47

have both wander around and swim randomly in the ai goal.

make sure it can breathe water

 

Create a new procedure:

If is Event/Target Entity in water

do return true

return false

Joined Dec 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
i have the similar issue…
Sun, 01/28/2024 - 13:00

i have the similar issue with crocodile and gharial, but they sit still on land

Joined Sep 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Do you have any Image of how…
Mon, 09/29/2025 - 12:57

Do you have any Image of how the Procedure should look like?

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
That's not the problem…
Sat, 10/25/2025 - 08:11

That's not the problem. Entities need two different AIs to do that, one that can navigate on land, and one that can navigate in water, like the Drowned, but MCreator doesn't seem to be able to do that. I need an entity that can walk and swim too, but you can either check or uncheck the "is water entity" box that determines its AI. If not water entity, they don't know how to swim in 3D and will only walk on the ocean floor or float up like villagers. If enabled Is Water Entity, they will swim in 3D but will stay put immobile on land, unable to walk. My only method of getting a mob to do both is by having two identical mobs, one water and the other land, and making a procedure that replaces one mob for the other whenever it enters or exits water, this /works/ but it's terrible, and also it erases all the entity data. We need a method of switching the mob pathfinding AI whether it's in water or not.