Is it possible to locate the position of a specific block in Minecraft Java

Is it possible to locate the position of a specific block in Minecraft Java - Black and white side view full body sporty swimmer in swimming suit and goggles standing on block in track start position preparing to dive in outside pool

I am building a datapack and I want to replace how diamonds and emeralds function by modifying their generation behavior. But I don't know if this is A : possible and B : worth my time looking in to. I did some research but could not find anything that was up-to-date with or answered when 1.18.x was around. I was told here in the comments that there was a command called /locateblock but I couldn't find anything on the wiki about the command or anything like it. So I am lead to believe that the command doesn't exist. If this is possible via Spigot or Fabric/Forge (As long as it is server-side) I would be willing to use a plugin/mod but I would like to avoid doing so.

If anyone is interested in or needs to know why I want to do this, I am extending on my question here to get closer to adding custom ores and gemstones without (hopefully) mods/external APIs.






Pictures about "Is it possible to locate the position of a specific block in Minecraft Java"

Is it possible to locate the position of a specific block in Minecraft Java - Full body barefoot sportswoman in sportswear doing yoga arm exercise on sport mat during training on lawn in park adhering to healthy lifestyle while looking down
Is it possible to locate the position of a specific block in Minecraft Java - Positive young woman doing yoga with blocks on lawn
Is it possible to locate the position of a specific block in Minecraft Java - From above of cute little child in white wear holding wood blocks for building while standing near wicker armchair



Can you locate a specific block in Minecraft?

The blank is for the particular block you are looking for. Let's say you're lost in the Nether and need to find your Nether Portal, you could type : /locateblock obsidian, and get the coordinates for the nearest obsidian, most likely being your, said, Portal.



Detect A Player's Location With Blocks In Minecraft Java Edition | 1.18+




Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Heart Rules, Gustavo Fring, Gustavo Fring, Tatiana Syrikova