let pendingActions = []

ServerEvents.tick(event => {
    for (let i = pendingActions.length - 1; i >= 0; i--) {
        let action = pendingActions[i]
        action.ticks--

        if (action.ticks <= 0) {
            action.run()
            pendingActions.splice(i, 1)
        }
    }
})