CCBlueX Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Unsolved [Machine translation]how to get the coordinates of all players

    ScriptAPI
    5
    6
    116
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      AACx_hacker last edited by

      [Machine translation]how to get the coordinates of all players

      exit scammed 1 Reply Last reply Reply Quote 0
      • exit scammed
        exit scammed @AACx_hacker last edited by exit scammed

        @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.
        }
        
        ? ? 6Sence 3 Replies Last reply Reply Quote 3
        • ?
          A Former User @exit scammed last edited by

          @wysi thats java code smh

          exit scammed 1 Reply Last reply Reply Quote 0
          • exit scammed
            exit scammed @Guest last edited by

            @britishbiscuit didnt notice that lol, edited

            1 Reply Last reply Reply Quote 3
            • ?
              A Former User @exit scammed last edited by

              @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
              }
              
              1 Reply Last reply Reply Quote 0
              • 6Sence
                6Sence @exit scammed last edited by

                @wysi what if they're out of render distance?

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                About
                • Terms of Service
                • Privacy Policy
                • Status
                • Contact Us
                Downloads
                • Releases
                • Source code
                • License
                Docs
                • Tutorials
                • CustomHUD
                • AutoSettings
                • ScriptAPI
                Community
                • Forum
                • Guilded
                • YouTube
                • Twitter
                • D.Tube