How do I give a player a message when their hunger is low?

I want players to get the message "Your hunger is low: eat something." when their hunger is at three bars.


You should set up a scoreboard to track their hunger: /scoreboard objectives add hunger food, and then in a repeating, always active command block (placed in a spawn chunk so its always loaded) put execute as @a[scores={hunger=6}] run say I need to eat something. I assumed that by 3 bars you meant three out of the ten, which is actually 6 hunger points, and that you want the message to play just once, not every tick that they have 6 or less food points, because that would probably be annoying. I also assumed it would be okay if the message is from the first person, but if it's not I can try to figure out how to use tellraw selectors. This is a 1.14 specific answer but should also work in 1.13 too.