> 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/2_conditions_screen.md).

# Conditions Screen

***

<div align="center"><img src="/files/8ogyqLYgmnXt91V8fsgG" alt="" width="75%"></div>

***

The Conditions Screen controls **when** the State Controller Block is allowed to run.

If conditions are defined and not satisfied:

* The marked "Off" State is applied
* The State cycle pauses
* No further States are applied
* Timing does not progress

Conditions are optional.\
If no conditions are configured, the controller runs continuously.

***

## 1. Number of Iterations

![](/files/gKYHjLXcYakAo0PTY3Gr)

At the top of the screen:

* ✔ Infinite — the State cycle repeats indefinitely.
* Unchecked — the cycle runs the specified number of Loops.

This determines how many times the defined States will execute before stopping.\
When the prescribed number of iterations has completed, the Target blocks will:

* Freeze on the last active State of the sequence, when there is no State Marked "Off"
* Apply and freeze on the Marked "Off" State when there is one defined

ℹ️ This setting applies to all Targets of this SCB globally.

***

## 2. Iterations with Conditions

If there are Conditions defined, the sequence will be interrupted when the condition returns `FALSE`.

If **NO** State is Marked "Off', this simply **Pauses** the sequences simply to be resumed when the conditions return `TRUE` again.\
Where there is a specified number of Loops (Infinite is unchecked), this would **NOT** be reset.

If there **IS** a State Marked "Off", it will be applied and the entire sequence will be reset upon conditions returning `TRUE` again.\
Where there is a specified number of Loops (Infinite is unchecked), this would **also** be reset.

***

## 3. Implicit Condition

![](/files/3yFMA4sXYc3WFzMlzsEa)

The SCB exposes itself 2 States (`ON` and `OFF`).\
There is an implicit condition that the SCB must be turned `ON` in order to affect its Targets.\
When turned `OFF`, the SCB does nothing, and all iteration sequences are:

* Paused for targets that do not have a Marked "Off" State
* Stopped on the Marked "Off" State and Reset, for targets that have one.

***

## 4. Condition Type

Each condition defines a rule that must be satisfied for the SCB to operate.

Multiple conditions can be added.\
All conditions must be satisfied simultaneously.\
A maximum of 8 conditions can be entered in the SCB.\
Multiple entries of the same condition type can used at the same time.

Most conditions require a Condition Target\
The **Condition Target Selector** allows targeting:

* The SCB itself:\
  ![](/files/FGHzz1tFhiGJ0WWhq20U)
* A block at a distance from one of its colored faces:\
  ![](/files/JylxxkcndOrtrO4ltiYu)

Many conditions also require a **Range** to be entered.\
This Range (in number of blocks) is the radius of a sphere around the Condition Target.

***

## 4.1 Player Nearby

![](/files/NmxOcyHuHqEgoMxXL4AW)

Returns `TRUE` when a player is within a defined `Range` from the `Condition Target`.

**Settings:**

* Condition Target Selector
* Range

***

## 4.2 NPC Nearby

![](/files/PdsZb3elGCNG9EpwlOE5)

Returns `TRUE` when an NPC of the specified `Type` is within a defined `Range` from the `Condition Target`.

**Settings:**

* Condition Target Selector
* Range
* NPC Type

The possible values for NPC Type are:

* All NPCs
* Non Hostile
* Hostile
* Ignore
* Neutral
* Friendly
* Revered

***

## 4.3 Item on Ground

![](/files/SOjxMfc9lIix53iLUsHV)

Returns `TRUE` when a dropped item in the specified `Item List` is detected within `Range` of the `Condition Target`.\
When **NO** item is specified, **ANY** item will cause the condition to return `TRUE`.\
`Item List` accepts a comma separated list of **Item ID** as seen in the tooltip in `op` mode:\
![](/files/UeaIdMAup0bRXaomaXxg)

**Settings:**

* Condition Target Selector
* Range
* Optional item filter (specific items only)

***

## 4.4 Block Placed

![](/files/92G3tQPS89BUkhgGNukZ)

Returns `TRUE` when a block in the specified `Block List` is placed within `Range` of the `Condition Target`.\
When **NO** block is specified, **ANY** block placement will cause the condition to return `TRUE`.\
`Block List` accepts a comma separated list of **Item ID** as seen in the tooltip in `op` mode:\
![](/files/UeaIdMAup0bRXaomaXxg)

ℹ️ **Block Placed** is a latch condition.\
This means that when the block placement is detected, the condition will return `TRUE` for the entire duration of looping iterations.\
⚠️ If used with **Infinite** checked, it will only reset if there exists a Marked "Off" State for the Target **AND** one of the following is true:

* the SCB is turned `OFF`
* another condition returns `FALSE`

**Settings:**

* Condition Target Selector
* Range
* Optional block filter (specific blocks only)

***

## 4.5 Block Broken

![](/files/N50mzyxzgxIivURIMYSN)

Returns `TRUE` when a block in the specified `Block List` is broken within `Range` of the `Condition Target`.\
When **NO** block is specified, **ANY** block breaking will cause the condition to return `TRUE`.\
`Block List` accepts a comma separated list of **Item ID** as seen in the tooltip in `op` mode:\
![](/files/UeaIdMAup0bRXaomaXxg)

ℹ️ **Block Broken** is a latch condition.\
This means that when the block breaking is detected, the condition will return `TRUE` for the entire duration of looping iterations.\
⚠️ If used with **Infinite** checked, it will only reset if there exists a Marked "Off" State for the Target **AND** one of the following is true:

* the SCB is turned `OFF`
* another condition returns `FALSE`

**Settings:**

* Condition Target Selector
* Range
* Optional block filter (specific blocks only)

***

## 4.6 Block State

![](/files/G6RIouDTgBTkf7ODd76Y)

Returns `TRUE` when the `Condition Target` is at the selected `State`.\
The **State Selector** dynamically fills with the available States of the `Condition Target`.

**Settings:**

* Condition Target Selector
* State Selector

***

## 4.7 Time of Day

![](/files/m3PWE2sognDeMUKC6l1j)

Returns `TRUE` when the current in-game time is within the specified Time Range.\
ℹ️ When `From Time` is smaller/before the `To Time`, the range will be from a day to the next (overnight).

**Settings:**

* From time
* To time

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://halekio.gitbook.io/state-controller-block/2_conditions_screen.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
