ZhabaKlava Posted May 9, 2018 Posted May 9, 2018 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? Quote
loordgek Posted May 9, 2018 Posted May 9, 2018 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 Quote
ZhabaKlava Posted May 9, 2018 Author Posted May 9, 2018 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. Quote
ZhabaKlava Posted May 9, 2018 Author Posted May 9, 2018 (edited) 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 May 9, 2018 by ZhabaKlava Missed word Quote
ZhabaKlava Posted May 9, 2018 Author Posted May 9, 2018 I think I already found. Just to confirm - I can see this in the method "addEntityToTracker" of the class "net.minecraft.entity.EntityTracker", right? Quote
jabelar Posted May 9, 2018 Posted May 9, 2018 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. 1 Quote Check out my tutorials here: http://jabelarminecraft.blogspot.com/
Recommended Posts
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.