Skip to content

Instantly share code, notes, and snippets.

@CAD97
Created September 8, 2015 16:56
Show Gist options
  • Save CAD97/86dad8fa7ae12ee2a1e5 to your computer and use it in GitHub Desktop.
Save CAD97/86dad8fa7ae12ee2a1e5 to your computer and use it in GitHub Desktop.
Custom low hertz clock in Minecraft
REPEAT scoreboard players add TIMER clock 1
CHAIN scoreboard players test TIMER clock 60
>CHAIN scoreboard players set TIMER clock 0
>CHAIN blockdata XXX YYY ZZZ {auto:1b}
IMPULSE blockdata ~ ~ ~ {auto:0b}
CHAIN scoreboard players add low_hz clock 1

First, let me explain the syntax I've used above. REPEAT/CHAIN/(IM)PULSE should be self explaining. The commands following are what's in the cmd block. Indent of a block means that it's chaining from previous.

BLOCK means it is conditional on the previous block in the chain.

The test score is the number of ticks between pulses. You could make it a score of its own for on-the-fly editing. !IMPORTANT! Make sure that the IMPULSE block is {auto:0b} when you leave it, otherwise it won't trigger again (as it's an impulse.)

I think as an idiom, if line is meant to be pulsed once, then rest a number of ticks, then it should be pulsed by an IMPULSE. REPEAT should only be used when the repeating nature is being used. This can help the layout of the blocks to be more indicative of their function: i.e. CHAIN carry a chain, REPEAT drive a chain at 20Hz, IMPULSE are triggered to pulse a chain.

Of note: this master clock could be made to send a pulse to many satellite clocks by just chaining more >CHAIN blocks along the chain. In theory you could even hook it up to run several TIMERs in parallel and, in effect, be a master clock, pulsing other satellite cmd clusters at whatever Hz is necessary.

As a side note, I should really formalize the .cb language above that I just pulled out of nowhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment