How do I make it so when I click a chest if that chests contains 9 iron ingots or gold ingots or diamonds or emeralds then it removes 9 of that item from the chest and adds 1 gold block or iron block or diamond block or emerald block but if it has 8 or less of that item that is stops and send the user a message but if the chest contains like 36 gold ingots that it turns it into 4 blocks etc so like 180 ingots turns it into 20 blocks etc everytime it divides the ingots in the chest with 9 removes all the ingots and adds the devided number of thems to the chest aka blocks
Thanks
Thanks