Jump to content

[1.20+] How to detect if there is a player within 160 blocks (10 chunks) of the player [Forge]


RoyMods

Recommended Posts

Hello forgers,
Can someone help me with with player detection functionality. I want the client to check if there is a player within 10 chunks of my character (same chunk included). So i need a way to constantly check if there is a player nearby. Maybe using the onClientTick event but i don't know what to use to achieve that. I've made mods back in forge 1.8 and a lot of things have changed since. Some methods got removed and some got changed. Any help is appreciated. 

Thank you!

Link to comment
Share on other sites

On 2/16/2024 at 1:53 PM, RoyMods said:

Hello forgers,
Can someone help me with with player detection functionality. I want the client to check if there is a player within 10 chunks of my character (same chunk included). So i need a way to constantly check if there is a player nearby. Maybe using the onClientTick event but i don't know what to use to achieve that. I've made mods back in forge 1.8 and a lot of things have changed since. Some methods got removed and some got changed. Any help is appreciated. 

Thank you!

I have something similar in my mod, what do you wanna do if there is a player within this radius?

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.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.