Jump to content

Recommended Posts

Posted (edited)

Solution:

As of now, I set the vampire bat's navigator and moveController variables like so in the constructor.

		this.moveController = new VampireBatMoveHelperController(this, 60, true);
		this.navigator = new FlyingPathNavigator(this, this.world);

VampireBatMoveController can be viewed on my linked Github (linked below; the entity/vampire_bat package), but currently only extends FlyingMovementController, overriding nothing, pending additional functionality at a later date.

 

==

 

Hi!

I'm trying to make a vampire bat which will attack various entities. I have registered the Goals to find targets and the bats can, at the moment attack them -- but only by walking to them. As bats don't walk, this seems like something that should be fixed.

 

How would I go about making them get to their targets through the air?

 

I've tried looking at the Ghast code (no melee attacks and not really what I'm looking for) and the Bee code (all obfuscated beyond readability), but to no avail! Minecraft doesn't really have great support, it seems, for flying mobs :/... Or am I wrong in that?

I've also researched pathfinding algorithms, but figured I should find out if Minecraft can do that for me before I write something from scratch!

 

Thanks!

 

Github: https://github.com/GenElectrovise/MagiksMostEvile/tree/1.15.2

Edited by GenElectrovise

How to ask a good coding question: https://stackoverflow.com/help/how-to-ask

Give logs, code, desired effects, and actual effects. Be thorough or we can't help you. Don't post code without putting it in a code block (the <> button on the post - select "C-type Language"): syntax highlighting makes everything easier, and it keeps the post tidy.

 

My own mod, Magiks Most Evile: GitHub (https://github.com/GenElectrovise/MagiksMostEvile) Wiki (https://magiksmostevile.fandom.com/wiki/Magiks_Most_Evile_Wiki)

Edit your own signature at https://www.minecraftforge.net/forum/settings/signature/

Posted
15 hours ago, Ugdhar said:

What about the code for those things that attack players that haven't slept? I believe they fly and attack with melee. Phantom I believe they are called.

Thought about them... Not quite what I'm looking for I think, as they only circle, but would be worth looking at!

 

14 hours ago, Budschie said:

If you want your vampire bats to fly through walls, you can also look at the vex entity and its pathfinding:

Vexes -- the most annoying and forgettable mob ever! I totally forgot about them! I gotta look at those! They've got more similar behaviour to what I intend for the Vampire Bats... I wasn't thinking they should go through walls, but that could be really interesting! I can always change it later! :) 

How to ask a good coding question: https://stackoverflow.com/help/how-to-ask

Give logs, code, desired effects, and actual effects. Be thorough or we can't help you. Don't post code without putting it in a code block (the <> button on the post - select "C-type Language"): syntax highlighting makes everything easier, and it keeps the post tidy.

 

My own mod, Magiks Most Evile: GitHub (https://github.com/GenElectrovise/MagiksMostEvile) Wiki (https://magiksmostevile.fandom.com/wiki/Magiks_Most_Evile_Wiki)

Edit your own signature at https://www.minecraftforge.net/forum/settings/signature/

Posted

Solved as in edit to topic ^^^

How to ask a good coding question: https://stackoverflow.com/help/how-to-ask

Give logs, code, desired effects, and actual effects. Be thorough or we can't help you. Don't post code without putting it in a code block (the <> button on the post - select "C-type Language"): syntax highlighting makes everything easier, and it keeps the post tidy.

 

My own mod, Magiks Most Evile: GitHub (https://github.com/GenElectrovise/MagiksMostEvile) Wiki (https://magiksmostevile.fandom.com/wiki/Magiks_Most_Evile_Wiki)

Edit your own signature at https://www.minecraftforge.net/forum/settings/signature/

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.