# Content Modification API

## Setup

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

```gradle
repositories {
    mavenCentral()
}

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

{% endtab %}

{% tab title="Kotlin" %}

```gradle
repositories {
    maven("https://repo1.maven.org/maven2")
}

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

{% endtab %}
{% endtabs %}

## Block Modification

{% code title="BlockModification.INSTANCE" %}

```java
// Set a new hardness value for the block.
void setHardness(Block block, float hardness);

// Set a new hardness value for the BlockState.
void setHardness(BlockState state, float hardness);

// Set a new resistance value for the block.
void setResistance(Block block, float resistance);

// Set both the hardness and resistance for the block.
void setStrength(Block block, float hardness, float resistance);

// Set both the hardness and resistance for the block.
void setStrength(Block block, float strength);

// Set a new SoundGroup for the block.
void setSoundGroup(Block block, BlockSoundGroup soundGroup);

// Set a new slipperiness value for the block.
void setSlipperiness(Block block, float slipperiness);

// Set a new luminance value for the block.
void setLuminance(Block block, int luminance);

// Set a new resistance value for the BlockState.
void setLuminance(BlockState state, int luminance);

// Set a new MapColor for the block.
void setMapColor(Block block, MapColor mapColor);

// Set a new MapColor for the BlockState.
void setMapColor(BlockState state, MapColor mapColor);

// Get the MapColor of the block.
MapColor getMapColor(Block block);

// Get the MapColor of the BlockState.
MapColor getMapColor(BlockState state);

// Set a new velocity multiplier value for the block.
void setVelocityMultiplier(Block block, float velocityMultiplier);

// Set a new jump velocity multiplier value for the block.
void setJumpVelocityMultiplier(Block block, float jumpVelocityMultiplier);

// Set whether the block has dynamic bounds.
void setDynamicBounds();

// Set whether the block ticks randomly.
void setRandomTicks(Block block, boolean randomTicks);

// Set whether a tool is required to mine the block.
void setToolRequired(Block block, boolean toolRequired);

// Set whether a tool is required to mine the blockstate.
void setToolRequired(BlockState state, boolean toolRequired);

// Set the loot table identifier of the block.
void setLootTableId(Block block, Identifier lootTableId);

// Set whether the block is opaque.
void setOpaque(Block block, boolean opaque);

// Set whether the blockstate is opaque.
void setOpaque(BlockState state, boolean opaque);

// Set whether the block can be lit on fire by lava.
void setBurnable(Block block, boolean burnable);

// Set whether the BlockState can be lit on fire by lava.
void setBurnable(BlockState state, boolean burnable);

// Set a new PistonBehavior for the block.
void setPistonBehavior(Block block, PistonBehavior pistonBehavior);

// Set a new PistonBehavior for the BlockState.
void setPistonBehavior(BlockState state, PistonBehavior pistonBehavior);

// Set a new Instrument for the block.
void setInstrument(Block block, Instrument instrument);

// Set a new Instrument for the blockstate.
void setInstrument(BlockState state, Instrument instrument);

// Set whether the block has block break particles.
void setBlockBreakParticles(Block block, boolean blockBreakParticles);

// Set whether the blockstate has block break particles.
void setBlockBreakParticles(BlockState state, boolean blockBreakParticles);

// Set whether the block is replaceable.
void setReplaceable(Block block, boolean replaceable);

// Set whether the blockstate is replaceable.
void setReplaceable(BlockState state, boolean replaceable);
```

{% endcode %}

## Item Modification

{% code title="ItemModification.INSTANCE" %}

```java
// Set the rarity of the item.
void setRarity(Item item, Rarity rarity);

// Get the rarity of the item.
Rarity getRarity(Item item);

// Set the max count of the item.
void setMaxCount(Item item, int maxCount);

// Set the max damage of the item.
void setMaxDamage(Item item, int maxDamage);

// Set whether the item is fireproof.
void setFireproof(Item item, boolean fireproof);

// Set the recipe remainder of the item.
void setRecipeRemainder(Item item, Item recipeRemainder);

// Set the food component of the item.
void setFoodComponent(Item item, FoodComponent foodComponent);
```

{% endcode %}

## Entity Type Modification

{% code title="EntityTypeModification.INSTANCE" %}

```java
// Set the entity type's spawn group.
void setSpawnGroup(EntityType<?> entityType, SpawnGroup spawnGroup);

// Set the entity type's primary spawn egg color.
void setPrimarySpawnEggColor(EntityType<?> entityType, int color);

// Get the entity type's primary spawn egg color.
int getPrimarySpawnEggColor(EntityType<?> entityType);

// Set the entity type's secondary spawn egg color.
void setSecondarySpawnEggColor(EntityType<?> entityType, int color);

// Get the entity type's secondary spawn egg color.
int getSecondarySpawnEggColor(EntityType<?> entityType);

// Set whether the entity type is summonable.
void setSummonable(EntityType<?> entityType, boolean summonable);

// Set whether the entity type is immune to fire damage.
void setFireImmune(EntityType<?> entityType, boolean fireImmune);

// Set whether the entity type can spawn far from the player.
void setSpawnableFarFromPlayer(EntityType<?> entityType, boolean spawnableFarFromPlayer);

// Set the entity type's loot table identifier.
void setLootTableId(EntityType<?> entityType, Identifier lootTableId);

// Set the entity type's dimensions.
void setDimensions(EntityType<?> entityType, EntityDimensions dimensions);
```

{% endcode %}

## Enchantment Modification

{% code title="EnchantmentModification.INSTANCE" %}

```java
// Set the enchantment rarity of the enchantment.
void setRarity(Enchantment enchantment, Enchantment.Rarity rarity);

// Set the acceptable items of the enchantment.
void setAcceptableItems(Enchantment enchantment, Predicate<ItemStack> acceptableItemPredicate);

// Set the minimum level of the enchantment.
void setMinLevel(Enchantment enchantment, int minLevel);

// Set the maxiumum level of the enchantment.
void setMaxLevel(Enchantment enchantment, int maxLevel);
```

{% endcode %}

## Status Effect Modification

{% code title="StatusEffectModification.INSTANCE" %}

```java
// Set the status effect's category.
void setCategory(StatusEffect statusEffect, StatusEffectCategory category);

// Set the status effect's color.
void setColor(StatusEffect statusEffect, int color);
```

{% endcode %}


---

# 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/content-modification-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.
