Home Commands Examples Getting Started With Scripts Global Keywords 1.21 Migration Guide
Equipable IItemStack ItemCooldowns ItemDefinition ItemStack UseOnContext
BracketDumpers BracketHandlers BracketValidators ResourceLocationBracketHandler

BowItem

Importing the class

If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.

script.zs
import crafttweaker.api.item.type.projectileweapon.BowItem;

Extends

BowItem extends ProjectileWeaponItem.

Implements

BowItem implements the following interfaces:

ItemLike

Undocumented Interfaces

FeatureElement,IItemExtension

Members

addAttributeModifier(attribute as Attribute, modifier as AttributeModifier, slot as EquipmentSlotGroup)
script.zs
// BowItem.addAttributeModifier(attribute as Attribute, modifier as AttributeModifier, slot as EquipmentSlotGroup);
myBowItem.addAttributeModifier(myAttribute, myAttributeModifier, myEquipmentSlotGroup);

Parameters:

addEnchantment(enchantment as Enchantment, level as int)
script.zs
// BowItem.addEnchantment(enchantment as Enchantment, level as int);
myBowItem.addEnchantment(myEnchantment, myInt);

Parameters:

enchantment Type: Enchantment
level Type: int
Getter
Gets a predicate for the supported projectiles for this item.
script.zs
// BowItem.allSupportedProjectiles as function(t as ItemStack) as bool
myBowItem.allSupportedProjectiles

Return Type: function(t as ItemStack) as bool

static ARROW_ONLY() as function(t as ItemStack) as bool
A predicate which only accepts arrow items
script.zs
// BowItem.ARROW_ONLY() as function(t as ItemStack) as bool;
BowItem.ARROW_ONLY();

Return Type: function(t as ItemStack) as bool

static ARROW_OR_FIREWORK() as function(t as ItemStack) as bool
A predicate which supports arrow items and fireworks
script.zs
// BowItem.ARROW_OR_FIREWORK() as function(t as ItemStack) as bool;
BowItem.ARROW_OR_FIREWORK();

Return Type: function(t as ItemStack) as bool

asItem() as Item
script.zs
// BowItem.asItem() as Item;
myBowItem.asItem();

Return Type: ItemDefinition

as Item
script.zs
// BowItem as Item
myBowItem as Item

Return Type: ItemDefinition

Setter
script.zs
// BowItem.attributeModifiers = (modifiers as ItemAttributeModifiers);
myBowItem.attributeModifiers = myItemAttributeModifiers;

Parameters:

Setter
script.zs
// BowItem.bannerPatterns = (patterns as BannerPatternLayers);
myBowItem.bannerPatterns = myBannerPatternLayers;

Parameters:

Setter
script.zs
// BowItem.baseColor = (baseColor as DyeColor);
myBowItem.baseColor = myDyeColor;

Parameters:

baseColor Type: DyeColor
Setter
script.zs
// BowItem.bees = (occupants as List<Occupant>);
myBowItem.bees = myList;

Parameters:

Setter
script.zs
// BowItem.blockEntityData = (data as CustomData);
myBowItem.blockEntityData = myCustomData;

Parameters:

data Type: CustomData
Setter
script.zs
// BowItem.blockState = (blockState as BlockItemStateProperties);
myBowItem.blockState = myBlockItemStateProperties;

Parameters:

Setter
script.zs
// BowItem.bucketEntityData = (data as CustomData);
myBowItem.bucketEntityData = myCustomData;

Parameters:

data Type: CustomData
Setter
script.zs
// BowItem.bundleContents = (bundleContents as BundleContents);
myBowItem.bundleContents = myBundleContents;

Parameters:

bundleContents Type: BundleContents
Setter
script.zs
// BowItem.canBreak = (predicate as AdventureModePredicate);
myBowItem.canBreak = myAdventureModePredicate;

Parameters:

Setter
script.zs
// BowItem.canPlaceOn = (predicate as AdventureModePredicate);
myBowItem.canPlaceOn = myAdventureModePredicate;

Parameters:

Setter
script.zs
// BowItem.chargedProjectiles = (chargedProjectiles as ChargedProjectiles);
myBowItem.chargedProjectiles = myChargedProjectiles;

Parameters:

chargedProjectiles Type: ChargedProjectiles
Getter
script.zs
// BowItem.commandString as string
myBowItem.commandString

Return Type: string

commandString() as string
script.zs
// BowItem.commandString() as string;
myBowItem.commandString();

Return Type: string

static commonItemComponents() as DataComponentMap
script.zs
// BowItem.commonItemComponents() as DataComponentMap;
BowItem.commonItemComponents();

Return Type: DataComponentMap

Setter
script.zs
// BowItem.container = (container as ItemContainerContents);
myBowItem.container = myItemContainerContents;

Parameters:

Setter
script.zs
// BowItem.containerLoot = (containerLoot as SeededContainerLoot);
myBowItem.containerLoot = mySeededContainerLoot;

Parameters:

Setter
script.zs
// BowItem.creativeSlotLock = (creativeSlotLock as bool);
myBowItem.creativeSlotLock = myBool;

Parameters:

creativeSlotLock Type: bool
Setter
script.zs
// BowItem.customData = (customData as CustomData);
myBowItem.customData = myCustomData;

Parameters:

customData Type: CustomData
Setter
script.zs
// BowItem.customModelData = (modelData as CustomModelData);
myBowItem.customModelData = myCustomModelData;

Parameters:

modelData Type: CustomModelData
Setter
script.zs
// BowItem.customName = (component as Component);
myBowItem.customName = myComponent;

Parameters:

component Type: Component
Setter
script.zs
// BowItem.debugStickState = (debugStickState as DebugStickState);
myBowItem.debugStickState = myDebugStickState;

Parameters:

debugStickState Type: DebugStickState
Getter
script.zs
// BowItem.defaultInstance as IItemStack
myBowItem.defaultInstance

Return Type: IItemStack

defaultInstance() as IItemStack
script.zs
// BowItem.defaultInstance() as IItemStack;
myBowItem.defaultInstance();

Return Type: IItemStack

implicit as IItemStack
script.zs
// BowItem as IItemStack
myBowItem as IItemStack

Return Type: IItemStack

Getter
Gets the default projectile range for this item.
script.zs
// BowItem.defaultProjectileRange as int
myBowItem.defaultProjectileRange

Return Type: int

Setter
script.zs
// BowItem.dyedColor = (color as DyedItemColor);
myBowItem.dyedColor = myDyedItemColor;

Parameters:

Setter
script.zs
// BowItem.enchantmentGlintOverride = (value as bool);
myBowItem.enchantmentGlintOverride = myBool;

Parameters:

value Type: bool
Setter
script.zs
// BowItem.enchantments = (enchantments as ItemEnchantments);
myBowItem.enchantments = myItemEnchantments;

Parameters:

enchantments Type: ItemEnchantments
Setter
script.zs
// BowItem.entityData = (data as CustomData);
myBowItem.entityData = myCustomData;

Parameters:

data Type: CustomData
Setter
script.zs
// BowItem.fireResistant = (intangibleProjectile as bool);
myBowItem.fireResistant = myBool;

Parameters:

intangibleProjectile Type: bool
Setter
script.zs
// BowItem.fireworkExplosion = (explosion as FireworkExplosion);
myBowItem.fireworkExplosion = myFireworkExplosion;

Parameters:

Setter
script.zs
// BowItem.fireworks = (fireworks as Fireworks);
myBowItem.fireworks = myFireworks;

Parameters:

fireworks Type: Fireworks
Setter
script.zs
// BowItem.food = (food as FoodProperties);
myBowItem.food = myFoodProperties;

Parameters:

static getPowerForTime(charge as int) as float
Converts the given time to a power value between 0 and 1

Returns: the given time as a power value between 0 and 1

script.zs
// BowItem.getPowerForTime(charge as int) as float;
BowItem.getPowerForTime(5);

Parameters:

charge Type: int - The charge to convert

Return Type: float

Setter
script.zs
// BowItem.hideAdditionalTooltip = (hideAdditionalTooltip as bool);
myBowItem.hideAdditionalTooltip = myBool;

Parameters:

hideAdditionalTooltip Type: bool
Setter
script.zs
// BowItem.hideTooltip = (hideTooltip as bool);
myBowItem.hideTooltip = myBool;

Parameters:

hideTooltip Type: bool
Setter
script.zs
// BowItem.instrument = (instrument as Instrument);
myBowItem.instrument = myInstrument;

Parameters:

instrument Type: Instrument
Setter
script.zs
// BowItem.intangibleProjectile = (intangibleProjectile as bool);
myBowItem.intangibleProjectile = myBool;

Parameters:

intangibleProjectile Type: bool
Setter
script.zs
// BowItem.itemName = (component as Component);
myBowItem.itemName = myComponent;

Parameters:

component Type: Component
Setter
script.zs
// BowItem.lockCode = (code as LockCode);
myBowItem.lockCode = myLockCode;

Parameters:

code Type: LockCode
Setter
script.zs
// BowItem.lodestoneTracker = (tracker as LodestoneTracker);
myBowItem.lodestoneTracker = myLodestoneTracker;

Parameters:

Setter
script.zs
// BowItem.lore = (lore as ItemLore);
myBowItem.lore = myItemLore;

Parameters:

lore Type: ItemLore
Setter
script.zs
// BowItem.mapColor = (mapColor as MapItemColor);
myBowItem.mapColor = myMapItemColor;

Parameters:

mapColor Type: MapItemColor
Setter
script.zs
// BowItem.mapDecorations = (mapDecorations as MapDecorations);
myBowItem.mapDecorations = myMapDecorations;

Parameters:

mapDecorations Type: MapDecorations
Setter
script.zs
// BowItem.mapId = (id as MapId);
myBowItem.mapId = myMapId;

Parameters:

id Type: MapId
Setter
script.zs
// BowItem.mapPostProcessing = (mapPostProcessing as MapPostProcessing);
myBowItem.mapPostProcessing = myMapPostProcessing;

Parameters:

mapPostProcessing Type: MapPostProcessing
Setter
script.zs
// BowItem.maxDamage = (maxDamage as int);
myBowItem.maxDamage = myInt;

Parameters:

maxDamage Type: int
Setter
script.zs
// BowItem.maxStackSize = (maxStackSize as int);
myBowItem.maxStackSize = myInt;

Parameters:

maxStackSize Type: int
Setter
script.zs
// BowItem.noteBlockSound = (sound as ResourceLocation);
myBowItem.noteBlockSound = myResourceLocation;

Parameters:

Setter
script.zs
// BowItem.ominousBottleAmplifier = (amplifier as int);
myBowItem.ominousBottleAmplifier = myInt;

Parameters:

amplifier Type: int
Setter
script.zs
// BowItem.potDecorations = (decorations as PotDecorations);
myBowItem.potDecorations = myPotDecorations;

Parameters:

decorations Type: PotDecorations
Setter
script.zs
// BowItem.potionContents = (potionContents as PotionContents);
myBowItem.potionContents = myPotionContents;

Parameters:

potionContents Type: PotionContents
Setter
script.zs
// BowItem.profile = (profile as ResolvableProfile);
myBowItem.profile = myResolvableProfile;

Parameters:

Setter
script.zs
// BowItem.rarity = (rarity as Rarity);
myBowItem.rarity = myRarity;

Parameters:

rarity Type: Rarity
Setter
script.zs
// BowItem.recipes = (recipes as List<ResourceLocation>);
myBowItem.recipes = myList;

Parameters:

recipes Type: List<ResourceLocation>
Getter
script.zs
// BowItem.registryName as ResourceLocation
myBowItem.registryName

Return Type: ResourceLocation

registryName() as ResourceLocation
script.zs
// BowItem.registryName() as ResourceLocation;
myBowItem.registryName();

Return Type: ResourceLocation

remove(type as DataComponentType<T>)
script.zs
// BowItem.remove(type as DataComponentType<T>);
myBowItem.remove(myDataComponentType);

Parameters:

Setter
script.zs
// BowItem.repairCost = (cost as int);
myBowItem.repairCost = myInt;

Parameters:

cost Type: int
setComponent(type as DataComponentType<T>, value as T)
script.zs
// BowItem.setComponent<T>(type as DataComponentType<T>, value as T);
myBowItem.setComponent<T>(myDataComponentType, myT);

Parameters:

value Type: T
setJsonComponent(type as DataComponentType<T>, value as IData)
script.zs
// BowItem.setJsonComponent(type as DataComponentType<T>, value as IData);
myBowItem.setJsonComponent(myDataComponentType, myIData);

Parameters:

value Type: IData
Setter
script.zs
// BowItem.storedEnchantments = (storedEnchantments as ItemEnchantments);
myBowItem.storedEnchantments = myItemEnchantments;

Parameters:

storedEnchantments Type: ItemEnchantments
Getter
Gets a predicate for the supported held projectiles for this item.


held projectiles are projectiles that can only be used when held in the off-hand while shooting / charging

script.zs
// BowItem.supportedHeldProjectiles as function(t as ItemStack) as bool
myBowItem.supportedHeldProjectiles

Return Type: function(t as ItemStack) as bool

Setter
script.zs
// BowItem.suspiciousStewEffects = (suspiciousStewEffects as SuspiciousStewEffects);
myBowItem.suspiciousStewEffects = mySuspiciousStewEffects;

Parameters:

suspiciousStewEffects Type: SuspiciousStewEffects
Setter
script.zs
// BowItem.tool = (tool as Tool);
myBowItem.tool = myTool;

Parameters:

tool Type: Tool
Setter
script.zs
// BowItem.trim = (trim as ArmorTrim);
myBowItem.trim = myArmorTrim;

Parameters:

trim Type: ArmorTrim
Setter
script.zs
// BowItem.unbreakable = (unbreakable as Unbreakable);
myBowItem.unbreakable = myUnbreakable;

Parameters:

unbreakable Type: Unbreakable
Setter
script.zs
// BowItem.writableBookContent = (writableBookContent as WritableBookContent);
myBowItem.writableBookContent = myWritableBookContent;

Parameters:

writableBookContent Type: WritableBookContent
Setter
script.zs
// BowItem.writtenBookContent = (writtenBookContent as WrittenBookContent);
myBowItem.writtenBookContent = myWrittenBookContent;

Parameters:

writtenBookContent Type: WrittenBookContent