To set Thirst up, first type the Command /function setup in Chat. Then, place down the Repeating Command Block and type in the command /function thirst.
How it works
You have a new Bar, the Water/Hydration Bar over your Hotbar This Value will slowly drop. The Higher it is, the stronger you feel and you get Positive Effects.
The Lower, the Worse you feel and you might die from Dehydration.
To refill the Bar, find a Water Source and Drink from it. That will Hydrate you.