Certain mana cannot be used to pay costs
He controlled a forest enchanted with "Hard Cookie", two copies of " Swamp ", and " Utopia Sprawl " (designated green), and had "King's Hospitality" in his hand.
In response to my opponent's attack, I wanted to pay the cost of the activated ability of "Hard Cookie" on the battlefield in green, black, and black, and use the remaining green mana to play a food that was turned into a creature from my hand. The black mana generated when paying for an activated ability could not be paid if selected.
-
[Deleted User] commented
Tough Cookie can only turn noncreature artifacts ON THE BATTLEFIELD into 4/4s. Meaning, you did not have anything to target with the Cookie's ability, therefore the game only used the green mana in your pool nessessary to let you make the Food token. You could then proceed to turn that Food into a 4/4 by using those two black mana and a green.
In other words, you were doing things out of order. The right order lets you do what you want: First, make the Food. Second, turn it into a 4/4.