> For the complete documentation index, see [llms.txt](https://docs.creoii.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.creoii.dev/creo-api/packages/block-injection-api.md).

# 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.
