X

NOTICE

Are you sure you want to report this?

We've split up the commands, scripting and mods, and add ons category! Please be sure you get your thread in the right place.

3

Locate coordinate to scoreboard

4 Comments

Post a new comment:

Please sign in to leave a comment.

  • 0
    tryashtar commented
    Comment actions Permalink

    It stores the distance. It's fairly trivial to triangulate from there.

  • 0
    Xavier Hervy commented
    Comment actions Permalink

    @tryashtar Thank you for this information. I did not realize about the distance.

     

    Still, it look like unnecessary calculation to me:

    - Trigonometric function can be costly;

    - you need more than one entry point which mean you can not get the information instantly, the player have to move.

    - Minecraft already know this information.

     

  • 0
    tryashtar commented
    Comment actions Permalink

    You're right, this would be better than what we have now, just mentioning the option

  • 1
    Comment actions Permalink

    One workaround for this is that you can use 1.13's exploration_map function in loot tables to get the coordinates of a structure. If you were to make a new loot table in a datapack with something like this:

    {
    "type": "item",
    "name": "minecraft:map",
    "functions": [
    {
    "function": "minecraft:exploration_map",
    "destination": "igloo",
    "decoration": "target_x",
    "zoom": 1,
    "skip_existing_chunks": false
    }
    ]
    }

    You can get the NBT from the resulting cartography map to locate the structure:

    loot spawn 0 -2 0 loot whatever:cartography
    execute positioned 0 -2 0 run tag @e[type=item,nbt={Item:{id:"minecraft:filled_map"}},distance=..1] add ourMap
    execute as @e[type=item,tag=ourMap] store result score X results run data get entity @s Item.tag.Decorations[0].x
    execute as @e[type=item,tag=ourMap] store result score Z results run data get entity @s Item.tag.Decorations[0].z
    kill @e[type=item,tag=ourMap]

    This doesn't always produce the closest structure, but it could be a viable alternative to trilatering from multiple reference points depending on your use case. It would certainly be nice if we could get the coordinates directly from the command instead.