Topic category: Help with Minecraft modding (Java Edition)
I've been making a flying dragonfly-esque mob (as the title suggests), and upon putting it in the game, it works fine, but it has a small bug; it idles/stays still at random intervals, like a land mob would. Any way to fix this and give it perpetual flight without stopping, e.g. using a procedure/changing the AI/goals or editing the mobs code altogether, even if I have no knowledge in that kinda stuff?
And yes; I've seen a post documenting this on the forum before, but the solution doesn't fix the problem, just causes build errors. Not to worry, I've reversed the method to it's original state and everything's back to normal, including the 'ol bug. Plus, the post is over a year old. :P
And no, I apparently can't submit tickets yet because I don't have the "permissions" to do so, so I'll have to post it here. I'm making decent progress on the mod, if you're curious. It's just this mob I'm a bit stuck on.
If you want me to send anything your way (videos, mob information), don't hesitate to gimme a nudge.
If you come up with any solution, I'll thank you a bunch!
hm... personally, I found that using the bat entity AI base causes a flying mob to fly constantly without landing on a block or randomly getting idle! i even used that workaround for a bug entity called "sporebug" on my mod Upon Infernal Depths, and it works like a charm (hopefully it will also work for you!) give it a shot :)
if you get any build errors with using it that you're not sure how to fix, let me know!
Thank you very much! I'll go try that now. I'll let you know if anything happens.
Got myself a build error, here's what went wrong:
Anything I can do to solve this?
ah, i'm assuming you put "wander around with speed factor [x]" under your entity's AI tasks. you should remove it now, since you're now basically extending your entity behavior from bats, and bats don't walk randomly so that task is unsupported
I'll go do check if I have it, and if I do, I'll remove it. Thanks again!
Turns out I did not. I removed something else that I figured was mucking the process up, and I still get the build error.
Here's the AI tasks for reference, top to bottom:
Fly around with speed factor (x)
Look around
Swim/float when in water
Leap at target entity with speed factor (x)
Any of these causing problems?
ohhh, now i found the issue! just remove "fly around with speed factor (x)", as the bat AI base already provides its own flight controller if I'm correct. once you remove that, your AI task list will also look similar to mine, which works :D
Will do! Thanks once again!
It finally worked! I'll be sure to save this for future reference, if this ever has another use.
good to hear! you're welcome :)
Seems have I like another thing on my hands. The mobs seem to stick to the ceiling once it comes in contact with such ceiling. Other than that, everything's in working order. Know a fix?
probably no easy fix for that and idk of any fix using code either... that also happens in my case :|
i hope it's not that big of an issue for you though! there could've been a possibility where i told you to make your own flight controller & path navigator then use it for your mob instead of simply extending your entity from bat's behavior (which you're doing for the mob rn) or using MCreator's kinda funny built-in flight controller (which causes flying mobs to be idle and/or have such weird movement), but that's way more complicated to make... and as i said, it's a workaround but sadly it ain't perfect...
Alrighty! Thanks for trying!