# /setblock

## Syntax

`setblock <pos> <node> [keep|replace]`

## Arguments

`<pos>` [Position](https://thepython10110.gitbook.io/better-commands/data-types#position)

Specifies the position of the block to be changed.

`<node>` [Node](https://thepython10110.gitbook.io/better-commands/data-types#item-node)

Specifies the new node.

`[keep|replace]` [String](https://thepython10110.gitbook.io/better-commands/data-types#string)

Specifies how to handle the node change. Must be one of:

* `keep` - Only air blocks are changed (non-air blocks are unchanged).
* `replace` - The node is set no matter what.

If not specified, defaults to `replace`.

Nodes are set with `minetest.set_node`, meaning that they do not activate the same callbacks as they would if placed by a player.

## History

| Version | Action                           |
| ------- | -------------------------------- |
| v1.0    | Added `/setblock` and `/setnode` |


---

# 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://thepython10110.gitbook.io/better-commands/commands/setblock.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.
