How Can I Get The Coordinates of A Player?
-
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?
-
@yletzter
.getPositionVector()
-
@commandblock2 im new to javascript could you tell me where I have to put the .getPositionVector()? Thanks!
-
@yletzter
target.getPositionVector()
-
@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
5/5