Minecraft / Java Programming - How can I check if the player has mining rights at the location?

Wo
1

Hi, I want to program that can spawn diamond blocks among the players, if he can build on the spot, problem is, how can I query if the player can build at the location?

Li

Either you build a permission, or create, for example, a map in which the player and a boolean is whether the player may dismantle or not. With these two means you can then check in the BlockBreakEvent whether the player either has the permission or whether, for example. Being boolean in a map is true.