ItemBuilderTool
A special builder that allows you to create items that can be used as tools. You should have set the item’s max damage before changing to this builder.
Has special methods that allow you to set the mining level for several tool types as well as the attack damage.
This class was added by a mod with mod-id contenttweaker
. So you need to have this mod installed if you want to use this feature.
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 ItemTypeBuilder
ItemBuilderTool extends ItemTypeBuilder. That means all methods available in ItemTypeBuilder are also available in ItemBuilderTool
Methods
Instructs CoT to actually build whatever this builder is supposed to be building.
Return Type: void
Parameter | Type | Description |
---|---|---|
Parameter resourceLocation | Type string | Description The resource path to give this block |
Allows you to set the attack damage bonus that you get when holding this item
Returns: This builder, used for method chaining
Return Type: ItemBuilderTool
Parameter | Type | Description |
---|---|---|
Parameter attackDamage | Type float | Description The additional attack damage |
Allows you to set the attack speed bonus that you get when holding this item.
Returns: This builder, used for method chaining.
Return Type: ItemBuilderTool
Parameter | Type | Description |
---|---|---|
Parameter attackSpeed | Type double | Description The attack speed |
Allows you to set the amount of damage that this item will receive when hitting enemies.
By default this is 0
Returns: This builder, used for method chaining
Return Type: ItemBuilderTool
Parameter | Type | Description |
---|---|---|
Parameter durabilityCostAttack | Type int | Description The damage points this item will receive |
Allows you to set the amount of damage that this item will receive when mining blocks.
By default this is 0
Returns: This builder, used for method chaining
Return Type: ItemBuilderTool
Parameter | Type | Description |
---|---|---|
Parameter durabilityCostMining | Type int | Description The damage points this item will receive |
Allows you to add a tool type to this tool. You can specify the type, the mining level and optionally the mining speed when this type is hit as well.
Returns: This builder, used for method chaining
Return Type: ItemBuilderTool
Parameter | Type | Description | Optional | DefaultValue |
---|---|---|---|---|
Parameter toolType | Type ToolType | Description The type of the tool | Optional false | DefaultValue |
Parameter miningLevel | Type int | Description The mining level for this tool type | Optional false | DefaultValue |
Parameter miningSpeed | Type float | Description How fast this tool can mine blocks of the given type | Optional true | DefaultValue 1.0 |