Home Commands Examples Getting Started With Scripts Global Keywords

Expansion for KnownTag<ItemDefinition>

This expansion specifically targets itemTags. It adds implicit casters to IIngredient and IData, so that you can use them wherever you can use IIngredient.

Only downside is that if you want to use Ingredient Transformers, you will need to call asIIngredient() first.

Casters

Result TypeIs Implicit
Result Type
IData
Is Implicit
true
Result Type
IIngredient
Is Implicit
true
Result Type
IIngredientWithAmount
Is Implicit
true

Methods

script.zs
KnownTag.add(items as stdlib.List<IItemStack>)
ParameterType
Parameter
items
Type
stdlib.List<IItemStack>

Return Type: IData

script.zs
// KnownTag.asIData() as IData
myKnownTag.asIData();

Return Type: IIngredient

script.zs
// KnownTag.asIIngredient() as IIngredient
myKnownTag.asIIngredient();

Return Type: IIngredientWithAmount

script.zs
// KnownTag.asIIngredientWithAmount() as IIngredientWithAmount
myKnownTag.asIIngredientWithAmount();