CrossbowItem
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.
import crafttweaker.api.item.type.projectileweapon.CrossbowItem;
Extends
CrossbowItem extends ProjectileWeaponItem
.
Implements
CrossbowItem
implements the following interfaces:
Undocumented Interfaces
FeatureElement
,IItemExtension
Members
asItem() as Item
as Item
// CrossbowItem as ItemDefinitionmyCrossbowItem as Item
Return Type:
ItemDefinition
Getter
// CrossbowItem.commandString as stringmyCrossbowItem.commandString
Return Type:
string
commandString() as string
// CrossbowItem.commandString() as string;myCrossbowItem.commandString();
Return Type:
string
static containsChargedProjectile(crossbowStack as ItemStack, ammoItem as Item) as bool
Checks if the given stack has any charged items of the given typescript.zs
Returns: true if it contains the charged item, false otherwise.
// CrossbowItem.containsChargedProjectile(crossbowStack as ItemStack, ammoItem as ItemDefinition) as bool;CrossbowItem.containsChargedProjectile(<item:minecraft:crossbow>, <item:minecraft:arrow>);
Parameters:
Return Type:
bool
Getter
// CrossbowItem.defaultInstance as IItemStackmyCrossbowItem.defaultInstance
Return Type:
IItemStack
defaultInstance() as IItemStack
implicit as IItemStack
// CrossbowItem as IItemStackmyCrossbowItem as IItemStack
Return Type:
IItemStack
Getter
Gets the default projectile range for this item.script.zs
// CrossbowItem.defaultProjectileRange as intmyCrossbowItem.defaultProjectileRange
Return Type:
int
static getChargeDuration(crossbowStack as ItemStack) as int
Gets the charged duration of the given stack.script.zs
Returns: the charged duration of the given stack.
CrossbowItem.getChargeDuration(<item:minecraft:crossbow>);
Return Type:
int
static isCharged(crossbowStack as ItemStack) as bool
static performShooting(level as Level, shooter as LivingEntity, hand as InteractionHand, crossbowStack as ItemStack, velocity as float, accuracy as float)
// CrossbowItem.performShooting(level as Level, shooter as LivingEntity, hand as InteractionHand, crossbowStack as ItemStack, velocity as float, accuracy as float);CrossbowItem.performShooting(myLevel, myLivingEntity, myInteractionHand, myItemStack, myFloat, myFloat);
Parameters:
shooter: LivingEntity
Type: LivingEntity
hand: InteractionHand
Type: InteractionHand
velocity: float
Type: float
accuracy: float
Type: float
Getter
// CrossbowItem.registryName as ResourceLocationmyCrossbowItem.registryName
Return Type:
ResourceLocation
registryName() as ResourceLocation
static setCharged(crossbowStack as ItemStack, charged as bool)
Sets the charged value on the given stack.script.zs
CrossbowItem.setCharged(<item:minecraft:crossbow>, true);
Getter
Gets a predicate for the supported held projectiles for this item. script.zs
held projectiles are projectiles that can only be used when held in the off-hand while shooting / charging
myCrossbowItem.supportedHeldProjectiles
Return Type:
function(t as ItemStack) as bool