Hey, recently, because of Coronavirus epidemy I thouught wether it is possible to simulate epidemy in Minecraft. And you know what? It is quite simple!
First of all i would like to present to you how this simulation works with this video of mine:
However, i would like to describe how it is done. So The mechanism is divided into two parts: Statistics and Epidemy. The patients are sheep and the color of their wool is a health state indicator:
WHITE - healthy, voulnerable to infection
GREEN - infected
GREY - recovered and temporarly immune (cannot be infected while grey)
PART 1: Simulating epidemy
How it works:
all white sheep Age nbt is constantly (cstl) being set to 600 tics (30s)
all green sheep are being constantly called to set all nearby white(*) sheep color to green (thus making them infected) (nearby equals to max distance = 1 block)
because the Age nbt is not modified on green sheeps so its Age (by natural) gradualy goes down to zero on each tick
when sheep Age is equal to 140 (7s) the sheep color turns to grey, making it impossible to being infected (because of (*), executes constantly)
when sheep Age is equal to 0 its color turns white again (executes constantly)
And we have full circle. Key aspect is the Age nbt tag. This nbt is supposed to indicate when the sheep is able to breed (only if equal to 0) and wether the sheep should be adult (age>=0) or a child (age < 0). Each tick the game increases/decreases its Age tag towards zero so it can be a great natural time counter.
PART 2: Statistics:
Each second (dictated by redstone clock) all statistics are set to zero and:
each white and grey sheep executes the command to increase Zdrowy (Healthy) by one
each green sheep executes the command to increase Zakażony (Infected) by one
each sheep executes the command to increase Wszyscy (All) by one
In video statistics are in Polish, but you get the point
And... thats it If you want I can share you a world download or commands to set up by yourself. Basicly to simulate epidemy you need 4 repeating command blocks... quite low amount.
I am really looking forward to this because you can basicly simulate very complex interractions manners. And if you want, show it to your kids/siblings or anyone that believes that it is stupid to stay home all the time Maybe such simple example may change their minds