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

# API Usage

## Maven & Gradle Examples

JavaDocs: <https://intellectualsites.github.io/fastasyncworldedit-javadocs/>

The WorldEdit documentation widely applies to FAWE too, you can find it here: <https://worldedit.enginehub.org/en/latest/api/index.html>

We suggest that FAWE operations are completed asynchronously. Using FAWE API from the main thread is likely to block the main thread if FAWE is used correctly. `Operations#complete` (and the other `Operations` methods) are blocking, as is `EditSession#close` so anything you want to happen after an edit, place after closing the EditSession with close(), try-with-resources, etc. Always ensure EditSessions are closed before doing anything else, and that you do not reuse EditSessions else changes may not necessarily be flushed to the world.

{% hint style="info" %}
The API requires using Java 21 at development time. Make sure to point your toolchain to Java 21.
{% endhint %}

If you are looking for snapshots, add the repository of S01 OSS Sonatype to the repositories' block.

### Gradle - FAWE Core

```kt
repositories {
    mavenCentral()
    maven("https://repo.papermc.io/repository/maven-public/")
    maven("https://maven.enginehub.org/repo/")
}

dependencies {
    implementation(platform("com.intellectualsites.bom:bom-newest:1.56")) // Ref: https://github.com/IntellectualSites/bom 
    compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Core")
}
```

### Gradle - FAWE Bukkit and Core

```kt
repositories {
    mavenCentral()
    maven("https://repo.papermc.io/repository/maven-public/")
    maven("https://maven.enginehub.org/repo/")
}

dependencies {
    implementation(platform("com.intellectualsites.bom:bom-newest:1.56")) // Ref: https://github.com/IntellectualSites/bom 
    compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Core")
    compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Bukkit") { isTransitive = false }
}
```

### Maven - Fawe Core

```xml
<repositories>
    <repository>
        <id>papermc</id>
        <url>https://repo.papermc.io/repository/maven-public/</url>
    </repository>
    <repository>
        <id>enginehub</id>
        <url>https://maven.enginehub.org/repo/</url>
    </repository>
</repositories>
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.intellectualsites.bom</groupId>
            <artifactId>bom-newest</artifactId> <!--  Ref: https://github.com/IntellectualSites/bom -->
            <version>1.56</version>
            <scope>import</scope>
            <type>pom</type>
        </dependency>
    </dependencies>
</dependencyManagement>
<dependency>
  <groupId>com.fastasyncworldedit</groupId>
  <artifactId>FastAsyncWorldEdit-Core</artifactId>
  <scope>provided</scope>
</dependency>
```

### Maven - FAWE Bukkit and Core

```xml
<repositories>
    <repository>
        <id>papermc</id>
        <url>https://repo.papermc.io/repository/maven-public/</url>
    </repository>
    <repository>
        <id>enginehub</id>
        <url>https://maven.enginehub.org/repo/</url>
    </repository>
</repositories>
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.intellectualsites.bom</groupId>
            <artifactId>bom-newest</artifactId> <!--  Ref: https://github.com/IntellectualSites/bom -->
            <version>1.56</version>
            <scope>import</scope>
            <type>pom</type>
        </dependency>
    </dependencies>
</dependencyManagement>
<dependencies>
    <dependency>
      <groupId>com.fastasyncworldedit</groupId>
      <artifactId>FastAsyncWorldEdit-Core</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>com.fastasyncworldedit</groupId>
        <artifactId>FastAsyncWorldEdit-Bukkit</artifactId>
        <scope>provided</scope>
        <exclusions>
            <exclusion>
                <artifactId>FastAsyncWorldEdit-Core</artifactId>
                <groupId>*</groupId>
            </exclusion>
        </exclusions>
    </dependency>
</dependencies>
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://intellectualsites.gitbook.io/fastasyncworldedit/api/api-usage.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
