ItemDefinition
Link to itemdefinition
Importing the class
Link to importing-the-class
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.
ZenScript Copyimport crafttweaker.api.item.ItemDefinition;
Implemented Interfaces
Link to implemented-interfaces
ItemDefinition implements the following interfaces. That means all methods defined in these interfaces are also available in ItemDefinition
Static Methods
Link to static-methods
Name: commonItemComponents
Return Type: DataComponentMap
ZenScript Copy// ItemDefinition.commonItemComponents() as DataComponentMap
ItemDefinition.commonItemComponents();
Casters
Link to casters
Result Type | Is Implicit |
---|---|
Result Type IItemStack | Is Implicit true |
Methods
Link to methods
Name: addAttributeModifier
ZenScript CopyItemDefinition.addAttributeModifier(attribute as Attribute, modifier as AttributeModifier, slot as EquipmentSlotGroup)
Parameter | Type |
---|---|
Parameter attribute | Type Attribute |
Parameter modifier | Type AttributeModifier |
Parameter slot | Type EquipmentSlotGroup |
Name: addEnchantment
ZenScript CopyItemDefinition.addEnchantment(enchantment as Enchantment, level as int)
Parameter | Type |
---|---|
Parameter enchantment | Type Enchantment |
Parameter level | Type int |
Name: getCommandString
Return Type: string
ZenScript Copy// ItemDefinition.getCommandString() as string
myItemDefinition.getCommandString();
Name: getDefaultInstance
Return Type: IItemStack
ZenScript Copy// ItemDefinition.getDefaultInstance() as IItemStack
myItemDefinition.getDefaultInstance();
Name: getRegistryName
Return Type: ResourceLocation
ZenScript Copy// ItemDefinition.getRegistryName() as ResourceLocation
myItemDefinition.getRegistryName();
Name: remove
ZenScript CopyItemDefinition.remove(type as DataComponentType)
Parameter | Type |
---|---|
Parameter type | Type DataComponentType |
Name: setComponent
ZenScript CopyItemDefinition.setComponent<T : Object>(type as DataComponentType<T>, value as T)
Parameter | Type |
---|---|
Parameter type | Type DataComponentType<T> |
Parameter value | Type T |
Parameter T | Type Object |
Name: setJsonComponent
ZenScript CopyItemDefinition.setJsonComponent(type as DataComponentType, value as IData?)
Parameter | Type |
---|---|
Parameter type | Type DataComponentType |
Parameter value | Type IData? |
Properties
Link to properties
Name | Type | Has Getter | Has Setter |
---|---|---|---|
Name attributeModifiers | Type ItemDefinition | Has Getter false | Has Setter true |
Name bannerPatterns | Type ItemDefinition | Has Getter false | Has Setter true |
Name baseColor | Type ItemDefinition | Has Getter false | Has Setter true |
Name bees | Type ItemDefinition | Has Getter false | Has Setter true |
Name blockEntityData | Type ItemDefinition | Has Getter false | Has Setter true |
Name blockState | Type ItemDefinition | Has Getter false | Has Setter true |
Name bucketEntityData | Type ItemDefinition | Has Getter false | Has Setter true |
Name bundleContents | Type ItemDefinition | Has Getter false | Has Setter true |
Name canBreak | Type ItemDefinition | Has Getter false | Has Setter true |
Name canPlaceOn | Type ItemDefinition | Has Getter false | Has Setter true |
Name chargedProjectiles | Type ItemDefinition | Has Getter false | Has Setter true |
Name commandString | Type string | Has Getter true | Has Setter false |
Name container | Type ItemDefinition | Has Getter false | Has Setter true |
Name containerLoot | Type ItemDefinition | Has Getter false | Has Setter true |
Name creativeSlotLock | Type ItemDefinition | Has Getter false | Has Setter true |
Name customData | Type ItemDefinition | Has Getter false | Has Setter true |
Name customModelData | Type ItemDefinition | Has Getter false | Has Setter true |
Name customName | Type ItemDefinition | Has Getter false | Has Setter true |
Name debugStickState | Type ItemDefinition | Has Getter false | Has Setter true |
Name defaultInstance | Type IItemStack | Has Getter true | Has Setter false |
Name dyedColor | Type ItemDefinition | Has Getter false | Has Setter true |
Name enchantmentGlintOverride | Type ItemDefinition | Has Getter false | Has Setter true |
Name enchantments | Type ItemDefinition | Has Getter false | Has Setter true |
Name entityData | Type ItemDefinition | Has Getter false | Has Setter true |
Name fireResistant | Type ItemDefinition | Has Getter false | Has Setter true |
Name fireworkExplosion | Type ItemDefinition | Has Getter false | Has Setter true |
Name fireworks | Type ItemDefinition | Has Getter false | Has Setter true |
Name food | Type ItemDefinition | Has Getter false | Has Setter true |
Name hideAdditionalTooltip | Type ItemDefinition | Has Getter false | Has Setter true |
Name hideTooltip | Type ItemDefinition | Has Getter false | Has Setter true |
Name instrument | Type ItemDefinition | Has Getter false | Has Setter true |
Name intangibleProjectile | Type ItemDefinition | Has Getter false | Has Setter true |
Name itemName | Type ItemDefinition | Has Getter false | Has Setter true |
Name lockCode | Type ItemDefinition | Has Getter false | Has Setter true |
Name lodestoneTracker | Type ItemDefinition | Has Getter false | Has Setter true |
Name lore | Type ItemDefinition | Has Getter false | Has Setter true |
Name mapColor | Type ItemDefinition | Has Getter false | Has Setter true |
Name mapDecorations | Type ItemDefinition | Has Getter false | Has Setter true |
Name mapId | Type ItemDefinition | Has Getter false | Has Setter true |
Name mapPostProcessing | Type ItemDefinition | Has Getter false | Has Setter true |
Name maxDamage | Type ItemDefinition | Has Getter false | Has Setter true |
Name maxStackSize | Type ItemDefinition | Has Getter false | Has Setter true |
Name noteBlockSound | Type ItemDefinition | Has Getter false | Has Setter true |
Name ominousBottleAmplifier | Type ItemDefinition | Has Getter false | Has Setter true |
Name potDecorations | Type ItemDefinition | Has Getter false | Has Setter true |
Name potionContents | Type ItemDefinition | Has Getter false | Has Setter true |
Name profile | Type ItemDefinition | Has Getter false | Has Setter true |
Name rarity | Type ItemDefinition | Has Getter false | Has Setter true |
Name recipes | Type ItemDefinition | Has Getter false | Has Setter true |
Name registryName | Type ResourceLocation | Has Getter true | Has Setter false |
Name repairCost | Type ItemDefinition | Has Getter false | Has Setter true |
Name storedEnchantments | Type ItemDefinition | Has Getter false | Has Setter true |
Name suspiciousStewEffects | Type ItemDefinition | Has Getter false | Has Setter true |
Name tool | Type ItemDefinition | Has Getter false | Has Setter true |
Name trim | Type ItemDefinition | Has Getter false | Has Setter true |
Name unbreakable | Type ItemDefinition | Has Getter false | Has Setter true |
Name writableBookContent | Type ItemDefinition | Has Getter false | Has Setter true |
Name writtenBookContent | Type ItemDefinition | Has Getter false | Has Setter true |