how to detect the position where i place a block 1.21.1

so ya, i want to make an event each time a player places a certain block (and multiple blocks can have this mechanic)

  1. The block can be placed by the player and by the game. It is naturally generated

  2. Im not interested in using raycast as they are generally super inaccurate for this kind of scenarios

  3. They are not custom blocks.

What i was using is to generate a 6-radii sphere of markers around the player to scan all the blocks the player has on his surroundings, then when he places a block then there will be a difference between the marker had detected one tick before, so i could grab the coordinates.

any help would be appreciated :33

Continue to help post