Giving rights by placing / dismantling a block?

Fi
- in Plugins
2

I wanted to program a plugin in Minecraft that gave me or the player who dismantles a gravel block, rights (e.g. OP rights), but I fail.

Ad

Source code

Br

This would be the code for the BlockBreak:

@EventHandler
public void onBreak (BlockBreakEvent e) {
if (e.getBlock (). GetType () == Material.GRAVEL) {
e.getPlayer () SETOP (true).
}
}

Simply swap the event for the block set.

If you want to give permissions, I think with attachments, but unfortunately I don't know exactly how. But is safe on the Internet.