Minecraft ComputerCraft Wiki
Advertisement
2011-12-27 11.47

The second version of TangentClock

Not to be confused with locks, clocks are programs that count in seconds, minutes, and/or hours. Clocks are fairly easy to program, and have some utility uses. By making the clock have an "alarm" signal, you could make it run a veriety of different farms or mob grinders.

So far, only one clock has been publicly posted, the "TangentClock". This clock can count up to an infinite amount of hours, and is currently under development.


Making Your Own Clock[]

There is a clock function built into Computercraft that let's you type

os.time()

and the computer will fetch the time of the Minecraft World. You can prefix this with

print(textutils.formatTime(os.time(), boolean))

this will print the time in the correct format.

edit boolean so that it is either true or false.

true = 24 hour clock false = 12 hour clock

for example:

print(textutils.formatTime(os.time(), true))

prints the clock in 24 hour format.

Edited by: 64bitminecraft

Advertisement