Navigation

    CCBlueX Forum

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

    How Can I Get The Coordinates of A Player?

    Scripts
    3
    5
    100
    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.
    • yLetzter
      yLetzter last edited by

      I want to have a Script which tells me the Coordinates of a Player!

      I already achieved this:

      target = Java.from(mc.theWorld.playerEntities).find(function (player) player.getName() == name.get())
      

      which gives this Output:
      EntityOtherPlayerMP['Playername'/7743, l='MpServer', x=-27, y=120, z=410]

      The Problem is that I want every Coordinate in a Variable... how Can I do this?

      C 1 Reply Last reply Reply Quote 0
      • C
        commandblock2 @yLetzter last edited by

        @yletzter
        .getPositionVector()

        yLetzter 1 Reply Last reply Reply Quote 0
        • yLetzter
          yLetzter @commandblock2 last edited by

          @commandblock2 im new to javascript could you tell me where I have to put the .getPositionVector()? Thanks!

          C Konoha Scarlet 2 Replies Last reply Reply Quote 0
          • C
            commandblock2 @yLetzter last edited by

            @yletzter
            target.getPositionVector()

            1 Reply Last reply Reply Quote 0
            • Konoha Scarlet
              Konoha Scarlet @yLetzter last edited by

              @yletzter getPositionVector() will return a Vec3 (or Vec3d in 1.9+)
              You can use .posX .posY .posZ to get the 3 coords
              I suggest to read codes of mcp918, it's helpful to code in js

              1 Reply Last reply Reply Quote 1
              • First post
                Last post