# Массивы и циклы

Массивы имеют следующий вид:

`var arr = ["A", "B", "C"] as string[];`

`var arr = [item, item, item];`

где\
\&#xNAN;*<mark style="color:blue;">**arr**</mark>* – имя массива (может быть почти любым),\
\&#xNAN;*<mark style="color:blue;">**as string**</mark>* – тип данных массива,\
\&#xNAN;*<mark style="color:blue;">**\[]**</mark>* – сам массив.

Массивы удобно применять с циклами и условными операторами.

Пример использования цикла for с массивами для добавления рецептов печки:

{% code lineNumbers="true" %}

```java
import crafttweaker.api.FurnaceManager;
var name = ["clay_to_brick", "packed_ice_to__ice", "grass_to_dir"] as string[];
var output = [<item:minecraft:bricks>, <item:minecraft:ice>, <item:minecraft:dirt>];
var input = [<item:minecraft:clay>, <item:minecraft:packed_ice>, <item:minecraft:grass_block>];
for i, item in output {
    furnace.addRecipe(name[i], item, input[i], 1.0, 30);
}
```

{% endcode %}

В этом примере первый массив name содержит список имен рецептов, массив <mark style="color:blue;">**output**</mark> – результат плавки, а массив <mark style="color:blue;">**input**</mark> – входные элементы. Затем создается цикл, который последовательно обрабатывает рецепт плавки для всех элементов массива.


---

# Agent Instructions: 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:

```
GET https://wiki.aegis-mine.ru/modifications/sozdanie-kontenta/crafttweaker/minecraft-1.16.5/massivy-i-cikly.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
