Jump to content




Command Utils - Get players' coordinates, and more


10 replies to this topic

#1 HPWebcamAble

  • Members
  • 933 posts
  • LocationWeb Development

Posted 07 September 2015 - 12:43 AM

The command computer is really cool. It is. But it has a few flaws.

This API is designed to let you get around those flaws!
(Yes this is an API. But it is only for Command Computers, so I decided it was a Command Program)


Here's the functions:
(There's no pastebin because its so short. Simply copy and paste the functions you'd like into your program)
Get players on the server, or players in a range

Get the coordinates of a player

Kill a player


These were just a few that I thought of.
Any suggestions for other functions?

Edited by HPWebcamAble, 07 September 2015 - 05:48 AM.


#2 MKlegoman357

  • Members
  • 1,170 posts
  • LocationKaunas, Lithuania

Posted 07 September 2015 - 05:28 AM

To get the coordinates of the computer you'd simply use commands.getBlockPosition(). Also, are you sure testforblock works like that in MC 1.7?

#3 HPWebcamAble

  • Members
  • 933 posts
  • LocationWeb Development

Posted 07 September 2015 - 05:48 AM

View PostMKlegoman357, on 07 September 2015 - 05:28 AM, said:

To get the coordinates of the computer you'd simply use commands.getBlockPosition()

Wow. Cant believe I forgot about that :P

Yes, my way works, but its ridiculous if there's already a function for it.

#4 Lupus590

  • Members
  • 2,029 posts
  • LocationUK

Posted 07 September 2015 - 11:17 AM

local coordinates to world coordinates converter, local coordinates use the command computer as 0,0,0 (can have negative y)

#5 HPWebcamAble

  • Members
  • 933 posts
  • LocationWeb Development

Posted 07 September 2015 - 04:35 PM

View PostLupus590, on 07 September 2015 - 11:17 AM, said:

local coordinates to world coordinates converter, local coordinates use the command computer as 0,0,0 (can have negative y)

Err, wouldn't you just add the local coords to the world coords?

What exactly are 'local coordinates' anyway?

#6 Lupus590

  • Members
  • 2,029 posts
  • LocationUK

Posted 07 September 2015 - 05:58 PM

View PostHPWebcamAble, on 07 September 2015 - 04:35 PM, said:

What exactly are 'local coordinates' anyway?

coordinates which use the command computer as the reference point (therefore the computer is 0,0,0 in local coordinates but could be anything in world coordinates)

#7 HPWebcamAble

  • Members
  • 933 posts
  • LocationWeb Development

Posted 07 September 2015 - 06:16 PM

View PostLupus590, on 07 September 2015 - 05:58 PM, said:

coordinates which use the command computer as the reference point (therefore the computer is 0,0,0 in local coordinates but could be anything in world coordinates)

Seems like I'd just use GPS at that point.

Is this something you've used in a program before?

#8 Lupus590

  • Members
  • 2,029 posts
  • LocationUK

Posted 07 September 2015 - 08:24 PM

it would mean that people using a command computer to make a box can put the computer where they want the box, and not have to type in 3 sets of (potentially) 4 digit coordinates

or you could support pairing with a pocket PC and make a client on it which transmits gps coords for the box

Edited by Lupus590, 07 September 2015 - 08:26 PM.


#9 HPWebcamAble

  • Members
  • 933 posts
  • LocationWeb Development

Posted 07 September 2015 - 08:45 PM

View PostLupus590, on 07 September 2015 - 08:24 PM, said:

it would mean that people using a command computer to make a box can put the computer where they want the box, and not have to type in 3 sets of (potentially) 4 digit coordinates

Thats a little too specific for a Command computer utility program. At least I think so.

View PostLupus590, on 07 September 2015 - 08:24 PM, said:

or you could support pairing with a pocket PC and make a client on it which transmits gps coords for the box

I was actually thinking about making a program like that, I'm waiting for MC 1.8 / 1.9, when we'll have access to additional commands like /fill or /clone, just to name a few.

Like I said, this doesn't really fit with a Command utility program, the idea is that these functions can provide the functionality usually available through something like a command block or a plugin/mod

#10 Lupus590

  • Members
  • 2,029 posts
  • LocationUK

Posted 07 September 2015 - 11:27 PM

I only see a need for local coordinates for if I was using a command computer.

Edit: I guess that if I was building with a turtle then local coordinates could use the turtles start position

Edited by Lupus590, 07 September 2015 - 11:29 PM.


#11 HPWebcamAble

  • Members
  • 933 posts
  • LocationWeb Development

Posted 07 September 2015 - 11:34 PM

I think a better term here is 'Relative Coordinates', as 0,0,0 is the block / turtle's starting position, not 0,0,0 in the MC world.

Edited by HPWebcamAble, 07 September 2015 - 11:34 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users