#How can I get the coordinates from a block that a player places in my world?

1 messages · Page 1 of 1 (latest)

serene rose
#

I have a advancement, witch gets triggered if someone places a custom chest (custom nbt data; custom Name; etc.) somewhere in my world.
I want the coordinates from the blog to use them in the function, witch gets triggered from the advancement.

How can I get these coordinates and how should I use these in the function, to editing right this block?

potent lodge
#

you have to do a raycast

limber roverBOT
potent lodge
#

but it feels like an xy-problem to me so could you specify why you'd need the coordinates of a block?

serene rose
#

I want to edit/add a custom Data to the chest

velvet crown
#

what sort of data? if it's for specifically a chest with custom data that implies you have control of the item and you should likely be able to include that data there directly

serene rose
#

I want to "Set the owner" so I want to put the uuid of the player (who placed the chest) in the nbt data of the chest to compare it later with the uuid from the player who opens the chest

#

I want to make two different Interfaces for "owner" and "a random Player"

serene rose
#

Is there a option to get the coordinates from the advancement?
So can the advancement detect on witch coordinates i placed the Block?

potent lodge
#

Nope but I believe you can just modify the item in the player's mainhand to contain the owner's uuid

#

It should keep the item's custom data stored in the placed block

#

Anyways, you should avoid raycasts as much as possible since they are quite performance intensive

serene rose
#

this was my next Idea but how can I later check the owner uuid with the uuid from the player interacting with the Block?