How to implement thirst

Discussion in 'Plugin Development' started by Maestroshnitzel, Jan 8, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    Maestroshnitzel

    Hi, I'm creating a plugin and I want to implement thirst. I already programmed a way for the player to drink, but not a way for the server to keep track of their thirst. How can I have the server store the players' thirst, and lower it by 10% every 5 minutes?
     
  2. Offline

    skipperguy12

  3. Offline

    ZeusAllMighty11


    You're going to need some knowledge of schedulers (link above), storing Player Objects as a String in a HashMap, and storing the integer for health. You may also use the EXP bar like MineZ does, not too hard to figure out
     
  4. Offline

    skipperguy12

    I tried to make something like this a while ago. I still never figured out how that damn bar works. Very frustrating =(
     
  5. Offline

    fireblast709

    float xpbar = current water level in float / max water level in float;
    player.setExp(xpbar);

    (you get the point of 'water level')
     
Thread Status:
Not open for further replies.

Share This Page