> For the complete documentation index, see [llms.txt](https://halekio.gitbook.io/state-controller-block/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://halekio.gitbook.io/state-controller-block/readme.md).

# Introduction

***

<div align="center"><img src="https://3617071669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfYnv2OFPyuUINVhw1xCV%2Fuploads%2Fgit-blob-b12c25f8ab34f8abc24759d32826181eac196af6%2FState_Controller_Block_Logo.png?alt=media" alt="" width="250"></div>

***

The **State Controller Block** is a programmable automation block that allows you to control the states nearby blocks using timers and conditions.

It works as a small, configurable state machine:\
you define states, assign durations, looping, and determine what triggers the state changes.

***

## What It Does

The block allows you to:

* Trigger block states in sequence
* Define how long each state remains active
* Enable or disable specific states
* Duplicate or reorder states in the loop
* Control which face and distance the block affects
* Add conditions such as player proximity, time of day, or block state checks

It is designed for building:

* Automatic doors and traps
* Timed mechanisms
* Conditional triggers
* Area-based automation
* Multi-stage sequences

***

## How It Works (Conceptually)

At its core, the State Controller Block:

1. Targets up to 6 blocks (one per face direction).
2. Affects blocks at a configurable distance.
3. Cycles through active states in order.
4. Applies each state for the defined duration.
5. Repeats infinitely or until iteration limits are met.
6. Optionally runs only when defined conditions are satisfied.

If conditions are not met, the state cycle pauses.

***

## Main Configuration Areas

The block has two configuration screens:

### Main Screen

Used to:

* Select target by face and distance
* Define states
* Set timing (minutes / seconds)
* Enable / disable states
* Duplicate or adjust ordering
* Set a "off" state

### Conditions Screen

Used to:

* Add environmental or player-based conditions
* Limit activation by range
* Restrict execution by time of day
* Require specific block states or nearby entities

Each screen is explained in detail in the next sections.

***

Continue to **Main Screen Configuration** to begin.
