CrossbowItem
Link to crossbowitem
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.type.projectileweapon.CrossbowItem;
Extending ProjectileWeaponItem
Link to extending-projectileweaponitem
CrossbowItem extends ProjectileWeaponItem. That means all methods available in ProjectileWeaponItem are also available in CrossbowItem
Static Methods
Link to static-methods
Name: getChargeDuration
Gets the charged duration of the given stack.
Returns: the charged duration of the given stack.
Return Type: int
ZenScript Copy// CrossbowItem.getChargeDuration(crossbowStack as ItemStack, entity as LivingEntity) as int
CrossbowItem.getChargeDuration(<item:minecraft:crossbow>, entity);
Parameter | Type | Description |
---|---|---|
Parameter crossbowStack | Type ItemStack | Description The stack to check |
Parameter entity | Type LivingEntity | Description The entity to get the charge duration for |
Name: isCharged
Checks if the stack is charged
Returns: true if charged, false otherwise.
Return Type: boolean
ZenScript Copy// CrossbowItem.isCharged(crossbowStack as ItemStack) as boolean
CrossbowItem.isCharged(<item:minecraft:crossbow>);
Parameter | Type | Description |
---|---|---|
Parameter crossbowStack | Type ItemStack | Description the stack to check |
Methods
Link to methods
Name: performShooting
ZenScript CopyCrossbowItem.performShooting(level as Level, shooter as LivingEntity, hand as InteractionHand, stack as ItemStack, power as float, accuracy as float, target as LivingEntity?)
Parameter | Type |
---|---|
Parameter level | Type Level |
Parameter shooter | Type LivingEntity |
Parameter hand | Type InteractionHand |
Parameter stack | Type ItemStack |
Parameter power | Type float |
Parameter accuracy | Type float |
Parameter target | Type LivingEntity? |