CrossbowItem
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.
Extending ProjectileWeaponItem
CrossbowItem extends ProjectileWeaponItem. That means all methods available in ProjectileWeaponItem are also available in CrossbowItem
Implemented Interfaces
CrossbowItem implements the following interfaces. That means all methods defined in these interfaces are also available in CrossbowItem
Static Methods
Checks if the given stack has any charged items of the given type
Returns: true if it contains the charged item, false otherwise.
Return Type: boolean
Parameter | Type | Description |
---|---|---|
Parameter crossbowStack | Type ItemStack | Description The stack to check |
Parameter ammoItem | Type ItemDefinition | Description The ammo to check for |
Gets the charged duration of the given stack.
Returns: the charged duration of the given stack.
Return Type: int
Parameter | Type | Description |
---|---|---|
Parameter crossbowStack | Type ItemStack | Description The stack to check |
Checks if the stack is charged
Returns: true if charged, false otherwise.
Return Type: boolean
Parameter | Type | Description |
---|---|---|
Parameter crossbowStack | Type ItemStack | Description the stack to check |
Parameter | Type |
---|---|
Parameter level | Type Level |
Parameter shooter | Type LivingEntity |
Parameter hand | Type InteractionHand |
Parameter crossbowStack | Type ItemStack |
Parameter velocity | Type float |
Parameter accuracy | Type float |
Sets the charged value on the given stack.
Parameter | Type | Description |
---|---|---|
Parameter crossbowStack | Type ItemStack | Description the stack to set the value on |
Parameter charged | Type boolean | Description the charged value |