How to Make Entity Choose Between Flying and Walking

Started by SilentStarling on

Topic category: Advanced modding

Last seen on 01:15, 25. Jul 2022
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to Make Entity Choose Between Flying and Walking

Sorry if this was repeated anywhere, I tried searching beforehand.

I am trying to make various insects (roaches, crickets, etc) who would both walk and fly. When I tick flying entity in the behavioral tab it makes them hover around and never land. When I give it the fly option and the walking option in the AI when it's not a "flying entity", it doesn't fly at all. I want the entity to choose between whether it's going to walk or fly. I thought I might be able to do this as a walking condition, or a flying condition, in the AI. However I'm having some trouble piecing it together in my head.

-Can I make it switch between walking and flying in a boolean-style if/else statement? Example: (check: is entity flying. If yes, make it walk. If no, make it fly)
-Can I make it do a check like this NOT every tick? Switching from walking to flying every tick would be terrible, could I make it wait a certain number of ticks before checking the condition again? I see there's a "repeat _ times, do ___" type of procedure, would that be what I use for something like this?

Sorry if this doesn't make much sense, my coding knowledge is pretty basic. Let me know if I need to clarify anything.

Last seen on 21:15, 28. Jun 2023
Joined Aug 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
make it choose, first by…
Wed, 10/26/2022 - 17:08

make it choose, first by making a flying entity and a ground entity. When it touches the ground it changes into that form, and backwards if it falls i guess.