Solved Thirst code

Discussion in 'Plugin Development' started by spookyDHD, Nov 30, 2013.

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

    spookyDHD

    Who has a code to get thirst in minecraft for my plugin (and that you can drink from a bottle?)

    grtz,
    me
     
  2. Offline

    boysnnoco

    spookyDHD go to plugin request, your basically asking for a whole plugin.
     
  3. Offline

    spookyDHD

    i need code for in my plugin. (for something what i want to add in my plugin has need this.)
     
  4. Offline

    L33m4n123

    Well nobody will give you complete code here most likely.

    So. Did you tried it at all already to implement the thirst yourself?
     
  5. Offline

    spookyDHD

    Yes, but i'm not so good in java to do it......
     
  6. Offline

    boysnnoco

    spookyDHD show us what you have so far so we can help you ;3
     
  7. Offline

    PolarCraft

    spookyDHD Do a consume event. Then do the xp bar as the thirst meter.
    [EDIT] As everyone that has posted on your thread we are not just going to give you the code. You will have to do it yourself.
     
  8. Offline

    Rprrr

    spookyDHD
    Run a repeating runnable. Take X amount of thirst from a player's thirst level (you can display it on the experience bar, for example, or on a scoreboard, or as a dragon's health bar, or in the chat or somewhere else) every time it runs. If the new player's thirst level is 0, start another runnable, which damages the player if his thirst level is still at 0 and the player is still alive and online. Otherwise, cancel it.
     
  9. Offline

    PolarCraft

    spookyDHD Or you can do what Rprrr said :D. Here is the thirst event. Now this is untested so yeah.
    Code:java
    1. @EventHandler
    2. public void onItemConsumed(PlayerItemConsumeEvent e)
    3. {
    4. Player p = e.getPlayer();
    5. if(e.getItem().getType().equals(Material.POTION))
    6. {
    7. //DO SOMETHING HERE!
    8. }
    9. }
    10. }
     
Thread Status:
Not open for further replies.

Share This Page