Skip to main content
Commonmark migration
Source Link

###Not easily.

Not easily.

You'll have to convert the player's position into a scoreboard objective first and then use that. There are no simple ways to do this.

The fastest way I can think of would be using an armorstand as a copy of the player, and teleport it around to figure out where it is using powers of 2: Check if x>256, increment score, teleport by -256, check if x>128, and so on...

That would require about 3×2log(Xmax-Xmin) command blocks for x, where Xmax and Xmin are the highest and lowest possible coordinates, and similar numbers for y and z. For a 256x256x256 cube, you are looking at (3×8)×3=72 command blocks.

To be multiplayer (or multi-entity)-friendly, you'll need to either perfectly identify every such armor stand to a player, or else do it sequentially for every player. Dealing with negative coordinates is another problem.

###Not easily.

You'll have to convert the player's position into a scoreboard objective first and then use that. There are no simple ways to do this.

The fastest way I can think of would be using an armorstand as a copy of the player, and teleport it around to figure out where it is using powers of 2: Check if x>256, increment score, teleport by -256, check if x>128, and so on...

That would require about 3×2log(Xmax-Xmin) command blocks for x, where Xmax and Xmin are the highest and lowest possible coordinates, and similar numbers for y and z. For a 256x256x256 cube, you are looking at (3×8)×3=72 command blocks.

To be multiplayer (or multi-entity)-friendly, you'll need to either perfectly identify every such armor stand to a player, or else do it sequentially for every player. Dealing with negative coordinates is another problem.

Not easily.

You'll have to convert the player's position into a scoreboard objective first and then use that. There are no simple ways to do this.

The fastest way I can think of would be using an armorstand as a copy of the player, and teleport it around to figure out where it is using powers of 2: Check if x>256, increment score, teleport by -256, check if x>128, and so on...

That would require about 3×2log(Xmax-Xmin) command blocks for x, where Xmax and Xmin are the highest and lowest possible coordinates, and similar numbers for y and z. For a 256x256x256 cube, you are looking at (3×8)×3=72 command blocks.

To be multiplayer (or multi-entity)-friendly, you'll need to either perfectly identify every such armor stand to a player, or else do it sequentially for every player. Dealing with negative coordinates is another problem.

Source Link
MrLemon
  • 17.4k
  • 6
  • 60
  • 83

###Not easily.

You'll have to convert the player's position into a scoreboard objective first and then use that. There are no simple ways to do this.

The fastest way I can think of would be using an armorstand as a copy of the player, and teleport it around to figure out where it is using powers of 2: Check if x>256, increment score, teleport by -256, check if x>128, and so on...

That would require about 3×2log(Xmax-Xmin) command blocks for x, where Xmax and Xmin are the highest and lowest possible coordinates, and similar numbers for y and z. For a 256x256x256 cube, you are looking at (3×8)×3=72 command blocks.

To be multiplayer (or multi-entity)-friendly, you'll need to either perfectly identify every such armor stand to a player, or else do it sequentially for every player. Dealing with negative coordinates is another problem.