In Spain we have a mining law that goes as follows: I have a plot of land, but I need a permission to mine it. But if mining company X suspects my plot can be mined, they can get permission to mine my plot before I do. They can't mine it if I don't let them, but if anyone is going to mine is the company.
IIRC, a few years ago some company called Odyssey that go around trying to unearth gold from antiquity, was reminded by the government that in Spain you can't do that, and every single gram of gold you find is property of the State. https://www.elmundo.es/cultura/2021/10/19/616e897de4d4d8e73f...
Unfortunately, our justice is painfully slow and ineficient, and Odissey got 500 millions in gold from a shipwreck due to a legal failure.