ProjectileWeaponItem
Link to projectileweaponitem
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.ProjectileWeaponItem;
Extending ItemDefinition
Link to extending-itemdefinition
ProjectileWeaponItem extends ItemDefinition. That means all methods available in ItemDefinition are also available in ProjectileWeaponItem
Static Methods
Link to static-methods
Name: ARROW_ONLY
A predicate which only accepts arrow items
Return Type: Predicate<ItemStack>
ZenScript Copy// ProjectileWeaponItem.ARROW_ONLY() as Predicate<ItemStack>
ProjectileWeaponItem.ARROW_ONLY();
Name: ARROW_OR_FIREWORK
A predicate which supports arrow items and fireworks
Return Type: Predicate<ItemStack>
ZenScript Copy// ProjectileWeaponItem.ARROW_OR_FIREWORK() as Predicate<ItemStack>
ProjectileWeaponItem.ARROW_OR_FIREWORK();
Properties
Link to properties
Name | Type | Has Getter | Has Setter | Description |
---|---|---|---|---|
Name allSupportedProjectiles | Type Predicate<ItemStack> | Has Getter true | Has Setter false | Description Gets a predicate for the supported projectiles for this item. |
Name defaultProjectileRange | Type int | Has Getter true | Has Setter false | Description Gets the default projectile range for this item. |
Name supportedHeldProjectiles | Type Predicate<ItemStack> | Has Getter true | Has Setter false | Description 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 |