Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I need my mod, which is client-side only, to retrieve and process posX, posY and posZ of every player on the server. I found some list I think is appropriate

Minecraft.getMinecraft().theWorld.playerEntities;

After some tests I figured out that there are indeed some players but not all. The list is missing the players which are far away from me or something like this. I don't really understand what criteria a player has to meet to be in that list. Is it some kind of security feature not to give such an information to a client?

the client does not need to know a player far away

i dont know a way around it

for what are you going to use it for sounds like a cheat mod

  • Author

Undoubtedly sounds like a cheat mod.

Actually, I want to make a command that is able to list all players which are inside a sphere centered at the player with radius R, where R is an argument of my command (e.g. /near 500).

Maybe I just need to bound R variable. Anyway I would like to know what players are included in the list.

  • Author
13 minutes ago, diesieben07 said:

For players this is 512 blocks.

Thanks, that's what I need to know. And yet one thing, where in the source code can I find that fact?

Edited by ZhabaKlava
Missed word

  • Author

I think I already found. Just to confirm - I can see this in the method "addEntityToTracker" of the class "net.minecraft.entity.EntityTracker", right?

Yes, when you're registering entities one of the things you specify is the entity tracker, which includes the range.

 

But as diesieben07 pointed out, you can't get the rest of the players unless the server sends it (which requires a server-side mod) so your original original idea is only possible if the radius that you're interested in is less than the tracking distance for the client. If that is true, then you're good to go.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.