Jump to content

[1.16.5] How to increase mob seeing distance?


Grandma

Recommended Posts

I am currently trying to create a mob which is an extension of skeleton.

The problem I am running into is that skeletons vision is limited to 15 blocks.

I would like to increase that distance to at-least 100 blocks.

 

Before I was using

minecraft.getInstance().player.canSee(entity)

but this does not work on server side as the server can have multiple players

 

I wanted to implement this on the mob side.

There are no instance I have found online that show this type of Behavior in execution.

 

does anyone know what I method I should look into? or Do you know of an example that has this in execution?

 

Thank you for any help

Link to comment
Share on other sites

Quote

i'm not 100% sure, but try setting FOLLOW_RANGE attribute to a different value when you set attributes.

Yea, I tried setting the follow_range. the skeleton just navigates towards the player.

I want the skeleton to be able to shoot from further away.

I have the shooting long distance figured out. I just want the ability for the skeleton to be able to detect the player.

 

Maybe to rephrase the question, I would like the skeleton to be able to detect the player as target for far away.

Edited by Grandma
Link to comment
Share on other sites

  • 2 weeks later...

If anyone has the same problem in the future. I resolved it by creating a custom goal. Added the custom goal to the mob.

In the custom goal -> tick() I used:

          1000 is the distance in blocks... I think.

PlayerEntity player = world.getNearestPlayer(this.mob,1000);
this.mob.canSee(player);

 

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.