Topic category: Mod ideas exchange
it's really simple actually...
Basic: (trust me) sorry i couldn't import the image i don't know how to...
event trigger - Player right clicks block
add a wait 1 tick on sever-side (to make sure it can reset)
inside of wait 1 tick, add the first If get item event/target entity is using = your block or item you want to use
at the bottom of the first if statement add what you want it to do, place, remove, spawn particles etc
inside of the if statement, add another If statement,
inside of the second If statement, add is even/entity target in game mode survival (Just to make sure that in creative mode the item or block doesn't get removed)
also add remove 1 item in main hand, in the second If statement
Hope this is helpful!!!! :)
you can add even more block and functions with this base of the procedure done! I use this for Bonemeal to my Custom Plants!