# Block Injection API

## Setup

{% tabs %}
{% tab title="Gradle" %}

```gradle
repositories {
    mavenCentral()
}

dependencies {
    modImplementation 'dev.creoii.creoapi:creo-block-injection-api:<VERSION>'
}
```

{% endtab %}

{% tab title="Kotlin" %}

```gradle
repositories {
    mavenCentral()
}

dependencies {
    modImplementation("dev.creoii.creoapi:creo-block-injection-api:<VERSION>")
}
```

{% endtab %}
{% endtabs %}

## Block Entity Type Injection

{% code title="BlockEntityTypeInjection.java" %}

```java
public static void inject(BlockEntityType<?> blockEntityType, Block block);

public static void inject(BlockEntityType<?> blockEntityType, Block... blocks);
```

{% endcode %}

The methods above are used to inject a **BlockEntityType** into a block or group of blocks.

## Point of Interest Type Injection

{% code title="PointOfInterestTypeInjection.java" %}

```java
public static void inject(RegistryKey<PointOfInterestType> poi, BlockState state);

public static void inject(RegistryKey<PointOfInterestType> poi, Block block);

public static void inject(RegistryKey<PointOfInterestType> poi, BlockState... states);

public static void inject(RegistryKey<PointOfInterestType> poi, Block... blocks);
```

{% endcode %}

The methods above are used to inject a **PointOfInterestType** into a block, blockstate, or group of either. Injecting into a block will inject the PointOfInterestType into all of its blockstates.

## Block State Property Injection

{% code title="BlockStatePropertyInjection.java" %}

```java
public static <T extends Comparable<T>> void inject(Property<T> property, Block block);

public static <T extends Comparable<T>> void inject(Property<T> property, Block... blocks);

public static <T extends Comparable<T>> void inject(Property<T> property, @Nullable T defaultValue, Block block);

public static <T extends Comparable<T>> void inject(Property<T> property, @Nullable T defaultValue, Block... blocks);
```

{% endcode %}

The methods above are used to inject BlockState Properties into a block, optionally with a defaultValue.


---

# 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://docs.creoii.dev/creo-api/packages/block-injection-api.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.
