# Structure

**Use one of these methods to add a** [**Structure Requirement**](/custom-machinery-1.21/recipes/requirements/structure.md) **to the recipe.**

```java
//Only requires the structure
.requireStructure(String[][] pattern, Map<char, String> keys)

//Destroys the structure (DON'T drop the blocks)
.destroyStructure(String[][] pattern, Map<char, String> keys)

//Break the structure (drops the blocks)
.breakStructure(String[][] pattern, Map<char, String> keys)

//Place the structure (drops the replaced blocks)
.placeStructure(String[][] pattern, Map<char, String> keys, true)

//Place the structure (DON'T drop the replaced blocks)
.placeStructure(String[][] pattern, Map<char, String> keys, false)
```

* The `pattern` param must be an array of array of strings. \
  See `pattern` property of structure requirement.\
  Example: `[["aaa", "aaa", "aaa"], ["aaa", "ama", "aaa"], ["aaa", "aaa", "aaa"]]` Define a 3x3x3 box around the machine `m`
* The `keys` param must be a map of string -> string. \
  See `keys` property of structure requirement.\
  The keys of the map must be single characters (except `m` which is reserved for the machine) and the values must be a block ID with the format: `namespace:block_id[state1=value,state2=value]` (states are optional).\
  Example: `{"a": "minecraft:stone", "b": "minecraft:diamond_block"}`

#### Example

```javascript
.requireStructure([[
    "aaa",
    "a a",
    "aaa",
    " m "
]], {"a": "minecraft:stone"})
```

A 3x1x3 hollow ring of stone behind the machine.


---

# 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://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/structure.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.
