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;
CrossbowItem extends ProjectileWeaponItem
.
CrossbowItem
implements the following interfaces:
Vanishable
,ItemLike
Undocumented Interfaces FeatureElement
, IItemExtension
Gets a predicate for the supported projectiles for this item. // CrossbowItem.allSupportedProjectiles as function(t as ItemStack) as bool
myCrossbowItem . allSupportedProjectiles
Return Type:
function(t as ItemStack ) as bool
A predicate which only accepts arrow items // CrossbowItem.ARROW_ONLY() as function(t as ItemStack) as bool;
CrossbowItem . ARROW_ONLY();
Return Type:
function(t as ItemStack ) as bool
A predicate which supports arrow items and fireworks // CrossbowItem.ARROW_OR_FIREWORK() as function(t as ItemStack) as bool;
CrossbowItem . ARROW_OR_FIREWORK();
Return Type:
function(t as ItemStack ) as bool
// CrossbowItem.commandString as string
myCrossbowItem . commandString
Return Type:
string
// CrossbowItem.commandString() as string;
myCrossbowItem . commandString();
Return Type:
string
Checks if the given stack has any charged items of the given type Returns : true if it contains the charged item, false otherwise.
// CrossbowItem.containsChargedProjectile(crossbowStack as ItemStack, ammoItem as Item) as bool;
CrossbowItem . containsChargedProjectile( < item : minecraft:crossbow > , < item : minecraft:arrow > );
Return Type:
bool
// CrossbowItem.defaultInstance as IItemStack
myCrossbowItem . defaultInstance
Return Type:
IItemStack
// CrossbowItem.defaultInstance() as IItemStack;
myCrossbowItem . defaultInstance();
Return Type:
IItemStack
// CrossbowItem as IItemStack
myCrossbowItem as IItemStack
Return Type:
IItemStack
Gets the default projectile range for this item. // CrossbowItem.defaultProjectileRange as int
myCrossbowItem . defaultProjectileRange
Return Type:
int
Gets the charged duration of the given stack. Returns : the charged duration of the given stack.
// CrossbowItem.getChargeDuration(crossbowStack as ItemStack) as int;
CrossbowItem . getChargeDuration( < item : minecraft:crossbow > );
Return Type:
int
Checks if the stack is charged Returns : true if charged, false otherwise.
// CrossbowItem.isCharged(crossbowStack as ItemStack) as bool;
CrossbowItem . isCharged( < item : minecraft:crossbow > );
Return Type:
bool
// 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:
velocity: float
Type: float
accuracy: float
Type: float
// CrossbowItem.registryName as ResourceLocation
myCrossbowItem . registryName
Return Type:
ResourceLocation
// CrossbowItem.registryName() as ResourceLocation;
myCrossbowItem . registryName();
Return Type:
ResourceLocation
Sets the charged value on the given stack. // CrossbowItem.setCharged(crossbowStack as ItemStack, charged as bool);
CrossbowItem . setCharged( < item : minecraft:crossbow > , true );
Parameters:
charged: bool
Type: bool
- the charged value
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
// CrossbowItem.supportedHeldProjectiles as function(t as ItemStack) as bool
myCrossbowItem . supportedHeldProjectiles
Return Type:
function(t as ItemStack ) as bool