How do you make a Thirst bar?

Started by gerbillover on

Topic category: Help with MCreator software

Active 7 years ago
Joined Oct 2016
Points:
760

User statistics:

  • Modifications: 1
  • Forum topics: 7
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 29
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
Active 9 months ago
Joined Jan 2017
Points:
700

User statistics:

  • Modifications: 0
  • Forum topics: 0
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 4
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
  •  

 

Active 7 years ago
Joined Oct 2016
Points:
760

User statistics:

  • Modifications: 1
  • Forum topics: 7
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 29
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?

Active 1 year ago
Joined Oct 2013
Points:
764

User statistics:

  • Modifications: 0
  • Forum topics: 6
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 23
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

Active 5 years ago
Joined Jan 2016
Points:
753

User statistics:

  • Modifications: 3
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 19
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.

Active 8 years ago
Joined Mar 2017
Points:
697

User statistics:

  • Modifications: 0
  • Forum topics: 0
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 2
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.

Active 4 years ago
Joined Jun 2016
Points:
3744

User statistics:

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

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