Translations:Modding:Block Entity/21/en
From Vintage Story Wiki
<syntaxhighlight lang="c#">
public void OnGameTick(float dt) { timer += dt; if(timer >= 3) { Block block = Api.World.BlockAccessor.GetBlock(Pos); if (block.Code.Path.EndsWith("-on")) { block = Api.World.GetBlock(block.CodeWithParts("off")); } else { block = Api.World.GetBlock(block.CodeWithParts("on")); }