How to make landscape that can be edited by gameplayers

If I want to make the editor’s tools available to players, for example, players can use the function of drawing terrain. Or, like “7 days to die” and “minecraft”, you can dig holes in the ground. Is there any good way? Also, if the ground is sloped, and the player places a building, the location of the building will be leveled (like “transport fever2”). What is the easier way to achieve it?