Skip to content

Items - Crafting Module

anvil.api.items.crafting

CraftingItemCatalog

Bases: AddonObject

identifier property

Returns the identifier of the addon object in the format 'namespace:name'.

Returns:

Name Type Description
str Identifier

The identifier of the addon object.

name property

Returns the name of the addon object.

Returns:

Name Type Description
str str

The name of the addon object.

add_group(category_name, group_name, group_icon, items_list=[])

Adds a group to an existing category.

Parameters:

Name Type Description Default
category_name str

The category name to update.

required
group_name str

The group name to add.

required
group_icon ItemDescriptor | BlockDescriptor

The item to use as the icon for the group.

required
items_list list[ItemDescriptor | BlockDescriptor]

List of items to add to the group. Defaults to an empty list.

[]

add_loose_items(category_name, items)

Adds loose items to a category.

Parameters:

Name Type Description Default
category_name ItemCategory

The category name to update.

required
items list[ItemDescriptor | BlockDescriptor]

List of items to add to the category.

required

Returns:

Name Type Description
CraftingItemCatalog CraftingItemCatalog

The current instance of CraftingItemCatalog.

content(content)

Sets the content of the addon object and returns the object.

Parameters:

Name Type Description Default
content any

The content to be set for the addon object.

required

Returns:

Name Type Description
self AddonObject

The instance of the current AddonObject.

do_not_shorten()

Setter property that disables shortening of dict when exporting.

PotionBrewingRecipe

Bases: _BaseRecipe

identifier property

Returns the identifier of the addon object in the format 'namespace:name'.

Returns:

Name Type Description
str Identifier

The identifier of the addon object.

name property

Returns the name of the addon object.

Returns:

Name Type Description
str str

The name of the addon object.

__init__(name, tags=['brewing_stand'])

Represents a Potion Brewing Container Recipe.

Parameters:

Name Type Description Default
name str

The name of the recipe.

required
tags list[str]

Tags associated with the recipe. Defaults to ["brewing_stand"].

['brewing_stand']

Documentation

content(content)

Sets the content of the addon object and returns the object.

Parameters:

Name Type Description Default
content any

The content to be set for the addon object.

required

Returns:

Name Type Description
self AddonObject

The instance of the current AddonObject.

do_not_shorten()

Setter property that disables shortening of dict when exporting.

recipe(item, reagent, output)

Sets the recipe for the potion brewing container.

Parameters:

Name Type Description Default
item ItemDescriptor | BlockDescriptor | Identifier

Input potion used in the brewing container recipe.

required
reagent ItemDescriptor | BlockDescriptor | Identifier

ItemDescriptor | BlockDescriptor used in the brewing container recipe with the input potio

required
output ItemDescriptor | BlockDescriptor | Identifier

Output potion from the brewing container recipe.

required

Returns:

Name Type Description
PotionBrewingRecipe

The current instance of PotionBrewingRecipe.

PotionMixingRecipe

Bases: _BaseRecipe

identifier property

Returns the identifier of the addon object in the format 'namespace:name'.

Returns:

Name Type Description
str Identifier

The identifier of the addon object.

name property

Returns the name of the addon object.

Returns:

Name Type Description
str str

The name of the addon object.

__init__(name, tags=['brewing_stand'])

Represents a Potion Mixing Recipe.

Parameters:

Name Type Description Default
name str

The name of the recipe.

required
tags list[str]

Tags associated with the recipe. Defaults to ["brewing_stand"].

['brewing_stand']

Documentation

content(content)

Sets the content of the addon object and returns the object.

Parameters:

Name Type Description Default
content any

The content to be set for the addon object.

required

Returns:

Name Type Description
self AddonObject

The instance of the current AddonObject.

do_not_shorten()

Setter property that disables shortening of dict when exporting.

recipe(item, reagent, output)

Sets the recipe for the potion mixing.

Parameters:

Name Type Description Default
item ItemDescriptor | BlockDescriptor | Identifier

Input potion used in the mixing recipe.

required
reagent ItemDescriptor | BlockDescriptor | Identifier

ItemDescriptor | BlockDescriptor used in the mixing recipe with the input potion.

required
output ItemDescriptor | BlockDescriptor | Identifier

Output potion from the mixing recipe.

required

Returns:

Name Type Description
PotionMixingRecipe

The current instance of PotionMixingRecipe.