Content Modification API
Utilities to modify vanilla content such as blocks, items, and entities.
Setup
repositories {
mavenCentral()
}
dependencies {
modImplementation 'dev.creoii.creoapi:creo-content-modification-api:<VERSION>'
}
repositories {
maven("https://repo1.maven.org/maven2")
}
dependencies {
modImplementation("dev.creoii.creoapi:creo-content-modification-api:<VERSION>")
}
Block Modification
BlockModification.INSTANCE
// 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);
Item Modification
ItemModification.INSTANCE
// 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);
Entity Type Modification
EntityTypeModification.INSTANCE
// 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);
Enchantment Modification
EnchantmentModification.INSTANCE
// 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);
Status Effect Modification
StatusEffectModification.INSTANCE
// Set the status effect's category.
void setCategory(StatusEffect statusEffect, StatusEffectCategory category);
// Set the status effect's color.
void setColor(StatusEffect statusEffect, int color);
Last updated