Jump to content

How to make a water mob swimming on place (perfectly still, no gravity)


Recommended Posts

Posted

Hi guys,

 

this thing drives me nuts. I can have a watermob swim anywhere I want, but I can't figure out how to make it swims on place perfectly still (like there was no gravity).

 

I tried almost everything but I am pretty sure one of you guys made it works. I tried calling a method of that type in updateAITasks. But the mobs always jump up and down. I just want it to stay still ... that simple. I am looking for a way to disable the gravity on it.

 

if ((!aWaterMob.isDead) && (aWaterMob!=null))

{

 

aWaterMob.motionY = 0.01F;

 

}

Posted

Briefly I just want to know what is the motionY value formula I need to put something so the mob will not go up or down...

 

Was not able to find the perfect value yet.

 

aWaterMob.motionY = ?

Posted

the movement event(From forge).

 

Umm...?

 

width=400 height=222http://images-cdn.9gag.com/photo/azbp0MB_460sa_v1.gif[/img]

 

(Sorry this post didn't bring anything new).

 

From what I remember (old times) - world has "gravity" that is pulling entity down. To hold entity in Y axis you could add vector = falling vector if entity is NOT on ground (onUpdate method). I was doing it so long ago that I don't think it will work now.

1.7.10 is no longer supported by forge, you are on your own.

Posted

As Ernio mentioned, just put 'this.motionY = 0.0F' in your mob's onUpdate method. If that doesn't work, try onLivingUpdate method. If neither work, try putting it before or after the call to super in either one.

 

It depends, of course, on how your mob's swimming is handled, for example if it has custom AI, but it should work (I can vouch for hovering in the air, at least).

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.