> 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/item-api.md).

# Item API

## Setup

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

```gradle
repositories {
    mavenCentral()
}

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

{% endtab %}

{% tab title="Kotlin" %}

```gradle
repositories {
    mavenCentral()
}

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

{% endtab %}
{% endtabs %}

## CreoItemSettings

An extension of **FabricItemSettings** that provides even more customizability for items.

```java
// Delay once the item is dropped until it can be picked up again.
private int pickupDelay;

// How long it takes for the item to despawn.
private int despawnTime;

// Whether the item floats or sinks in fluids.
private boolean buoyant;

// The amount of downwards gravity applied to the item when dropped.
private double gravity;

// How fast a Hopper transfers the item to another Hopper or container.
private int hopperTransferRate;

// How fast the item rotates when on the ground.
private float rotationModifier;

// Makes the item picked up by right-clicking instead of collision.
private boolean clickPickup;

// What fuel items are required to smelt this item, if smeltable.
private RegistryEntryList<Item> requiredFuels;
```

## CreoItem

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

```java
// Determines whether CreoBlock#onAttackThroughBlock can be called.
boolean canAttackThroughBlock(ServerPlayerEntity player, ItemStack stack, Entity target);

// Called when the item attacks an entity through a block.
void onAttackThroughBlock(ServerPlayerEntity player, ItemStack stack, Entity target);
```

{% endcode %}
