[Machine translation]how to get the coordinates of all players
Unsolved
ScriptAPI
-
[Machine translation]how to get the coordinates of all players
-
@aacx_hacker you can do a for loop with
mc.theWorld.playerEntities
, something like this:for (EntityPlayer e : (List<EntityPlayer>) mc.theWorld.playerEntities) { // in this case use e.posX, e.posY, e.posZ to get the coordinates. }
edit: since the category is scriptapi then here is the js version:
for (i=0;i<mc.theWorld.playerEntities.size();i++) { var e = mc.theWorld.playerEntities.get(i); // js automatically declare the type of variable at runtime so just use e.posX, e.posY, e.posZ like the one above. }
-
@wysi thats java code smh
-
@britishbiscuit didnt notice that lol, edited
-
@wysi said in [Machine translation]how to get the coordinates of all players:
@aacx_hacker you can do a for loop with
mc.theWorld.playerEntities
, something like this:for (EntityPlayer e : (List<EntityPlayer>) mc.theWorld.playerEntities) { // in this case use e.posX, e.posY, e.posZ to get the coordinates. }
edit: since the category is scriptapi then here is the js version:
for (i=0;i<mc.theWorld.playerEntities.size();i++) { var e = mc.theWorld.playerEntities.get(i); // js automatically declare the type of variable at runtime so just use e.posX, e.posY, e.posZ like the one above. }
you can just do this:
for (e : mc.theWorld.playerEntities) { var x = e.posX; // same with y and z }
-
@wysi what if they're out of render distance?