How do you make a Thirst bar?

Started by gerbillover on

Topic category: Help with MCreator software

Joined Oct 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do you make a Thirst bar?
Wed, 01/11/2017 - 19:24 (edited)

I'm trying to make a thirst bar for my new mod (Not Magicka, it's a private one so far), but I cannot find any way to do this. I have tried using overlays, and this makes the bar appear but I am clueless as to how to make the thirst drop over time and kill the player when it reaches 0. I know this will probably require code and I am prepared to write any code needed if you can provide for me. Thank you for your time. I am using 1.7.1 MCreator (Version 1.10.2 of MC)

Edited by gerbillover on Wed, 01/11/2017 - 19:24
Joined Jan 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
After every tick, decrease a
Thu, 01/12/2017 - 13:27

After every tick, decrease a timer value by 1, the timer being 6000, when it reaches 0

  • If thirst integer is 0
  • Take damage every 5 seconds
  • Else
  • Decrease the thirst image by 1
  • Decrease the thirst integer by 1
  •  

 

Joined Oct 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Ok, I just need to know the
Thu, 01/12/2017 - 14:16

Ok, I just need to know the piece of code for how to make something happen each tick. Is it OnUpdateTick() or something similar?

Joined Oct 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Would love to see a more
Fri, 03/10/2017 - 19:32

Would love to see a more detailed version of how to do this

Joined Jan 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Its most likely to be the
Sat, 03/18/2017 - 17:40

Its most likely to be the update tick. Create an event and put the decrease of thirst every tick.

Joined Mar 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Tell me please how to
Sat, 03/18/2017 - 17:59

Tell me please how to properly export the mod. When I export, I get an error.

Joined Jun 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You need a variable. Code is
Sat, 03/18/2017 - 22:00

You need a variable. Code is not required for variables.