Jump to content

[1.16.1] Fixing Squid Entity's movement


DavidQF555

Recommended Posts

I am making a custom entity that extends a SquidEntity, but I cannot get it to move to where I want. Squids normally only move randomly so their travel method looks like: 

 public void travel(Vector3d p_213352_1_) {
      this.move(MoverType.SELF, this.getMotion());
   }

and the random movement looks like: 

 this.squid.setMovementVector(f1, f2, f3);

I'm trying to use the tryMoveToXYZ method from the navigator. Changing the travel method to: 

@Override
public void travel(Vector3d vec) {
 	setMovementVector(vec.subtract(getPositionVec()).normalize());
  super.travel(vec);
}

makes the squid go in weird directions and it just doesn't stop until it hits a wall. I replaced the PathNavigator with a SwimmerPathNavigator. How could I make the travel method actually work for navigating to where I want it to?

Link to comment
Share on other sites

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.