The update event is an event that is triggered every tick or every time the block is "updated". How often the update event is triggered can be changed using the tickrate attribute. It can be a wee bit anoying if you do it wrong so pay attention.​ Do not do something like below without setting a high tickrate or including a restriction of some kind.

update="world.spawnMob(origin, \"Creeper\");
If you use the above example without a high tickrate, you will have a huge amount of creepers spawning in one area, possibly causing up to 20 creepers to spawn per second. If you do not want to use a high tick rate or you want to be able to make the spawn times slightly less predictable, then you can include the Math.random function to vary the spawn rate. An example of how to use the Math.random function for this event can be found below.
update="if(Math.floor(Math.random()*2)==0)world.spawnMob(origin, \"Creeper\");

This will cause creepers to have a 50% chance to spawn each time the update event is triggered. If you want to have a lower chance of the creeper spawning, just change the 2 to a higher number. The chance that the creeper will spawn can be found by taking 100 divided by the number you replaced 2 with.

Example Uses