How to make a procedure performed once per game day or once per game hour?

Started by dsclusv on

Topic category: Help with MCreator software

Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make a procedure performed once per game day or once per game hour?

Good day.

I'm trying to implement a disease and attrition system.

For example, there is a poisoning that a player can get by eating spoilt meat, drinking dirty water, eating uncooked food and so on.

If the player has poisoning, the maximum depletion value is reduced by 20 units and every game day (EXAMPLE!!!) the current depletion value is increased by 0.25 units.

Can be not only game day, but also game hour. The main thing is the periodicity. As long as the disease is not cured, there will be negative effects.

If I've figured out how to make this disease appear with a certain chance for the player, how can I make the exhaustion system work? I don't really understand. I've attached a picture of my attempt to make such a system in a screenshot on Google drive.

I would be very grateful for your help.

Link:

https://drive.google.com/file/d/1OQAfQzWSlnu-SY2d18lA87Tvo6RFrmpM/view?…

Joined Nov 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
For a day, detect every time…
Sat, 02/03/2024 - 01:28

For a day, detect every time either the player sleeps or the time is morning.

For an hour, create a variable that increases every game tick. When the variable is divisible by 72000 (20 TPS*60 minutes*60 seconds), an hour of in game time will have elapsed.

Joined Nov 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
*increases by 1 every game…
Sat, 02/03/2024 - 01:29

*increases by 1 every game tick