i would like to make it to where when i right click on a block with an item in my hand it returns an item - for example if i click on the block with a diamond in my hand it removes the diamond and gives you a emerald if anyone could help me please do i have been trying to figure this out for about 3 days now lol
You use the method for right clicking blocks. In your block class. Then you check for a diamond in the hand. Then you create an item stack that you add to the inventory or that you drop or something.
On Block right click