Melons could be challenging to find, depending on your world's seed and your luck. If you do find one, you can start a melon farm by planting seeds and harvest your own melon.
Usually, people use melon mainly for brewing purposes. It is rarely that a player would eat a melon slice to fill its hunger. This is because the hunger bar has another "hidden" bar, so even if you are only "slightly hungry" and eat a big steak, the steak will not go waste. Here's why:
There are four fields in level.dat which are related to hunger:
foodLevel ranges from 0 to 20 and is represented by the player's Food Bar.
foodSaturationLevel is an invisible additional hunger variable that is depleted before main foodLevel value. Eating any food will also add some to this variable. Note that this cannot exceed foodLevel. The Food Bar jitters when this equals 0.
foodTickTimer increases with every tick when foodLevel is either greater than 17 or equals zero. When foodTickTimer reaches 80, it resets to zero and then heals or deals one point of damage to the Health Bar, respectively.
foodExhaustionLevel ranges from 0.0 to 4.0 and increases with every action the player takes. When the exhaustion level reaches above 4.0, it will be subtracted by 4.0 and subtracts 1 point either from foodSaturationLevel or, if foodSaturationLevel equals zero, from foodLevel.
As you can see, if your
foodLevel just went down from full (20) to "slightly hungry (19)", it implies that your
foodSaturationLevel has went down to 0. Now suppose you eat a slice of melon, you'll restore food points plus a mere 1.2
foodSaturationLevel. When you eat a steak, however, you'll restore 12.8
foodSaturationLevel, which means you will get hungry again much later.