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.
Source code
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.