import { World } from 'Minecraft'; let ticks = 0; World.events.tick.subscribe(() => { ticks++; if (ticks >= 1200) return; const players = World.getPlayers(); for (let v of players) { const h = v.getComponent('health'); if (h.current < 20) { h.setCurrent(h.current + 1); } else h.setCurrent(1); } });