ItemBuilderTool
Link to 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.
Diese Klasse importieren
Link to diese-klasse-importieren
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.
ZenScript Copymods.contenttweaker.item.tool.ItemBuilderTool
Implemented Interfaces
Link to implemented-interfaces
ItemBuilderTool implements the following interfaces. That means any method available to them can also be used on this class.
Methoden
Link to methoden
build
Link to build
Instructs CoT to actually build whatever this builder is supposed to be building.
ZenScript Copynew ItemBuilder().withMaxDamage(150).withType<ItemBuilderTool>().build(resourceLocation as String);
new ItemBuilder().withMaxDamage(150).withType<ItemBuilderTool>().build("my_awesome_block");
Parameter | Type | Beschreibung |
---|---|---|
Parameter resourceLocation | Type String | Beschreibung The resource path to give this block |
withAttackDamage
Link to withattackdamage
Allows you to set the attack damage bonus that you get when holding this item
Returns: This builder, used for method chaining
Rückgabetyp: mods.contenttweaker.item.tool.ItemBuilderTool
ZenScript Copynew ItemBuilder().withMaxDamage(150).withType<ItemBuilderTool>().withAttackDamage(attackDamage as float);
new ItemBuilder().withMaxDamage(150).withType<ItemBuilderTool>().withAttackDamage(2.0f);
Parameter | Type | Beschreibung |
---|---|---|
Parameter attackDamage | Type float | Beschreibung The additional attack damage |
withAttackSpeed
Link to withattackspeed
Allows you to set the attack speed bonus that you get when holding this item.
Returns: This builder, used for method chaining.
Rückgabetyp: mods.contenttweaker.item.tool.ItemBuilderTool
ZenScript Copynew ItemBuilder().withMaxDamage(150).withType<ItemBuilderTool>().withAttackSpeed(attackSpeed as double);
new ItemBuilder().withMaxDamage(150).withType<ItemBuilderTool>().withAttackSpeed(2.0d);
Parameter | Type | Beschreibung |
---|---|---|
Parameter attackSpeed | Type double | Beschreibung The attack speed |
withDurabilityCostAttack
Link to withdurabilitycostattack
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
Rückgabetyp: mods.contenttweaker.item.tool.ItemBuilderTool
ZenScript Copynew ItemBuilder().withMaxDamage(150).withType<ItemBuilderTool>().withDurabilityCostAttack(durabilityCostAttack as int);
new ItemBuilder().withMaxDamage(150).withType<ItemBuilderTool>().withDurabilityCostAttack(5);
Parameter | Type | Beschreibung |
---|---|---|
Parameter durabilityCostAttack | Type int | Beschreibung The damage points this item will receive |
withDurabilityCostMining
Link to withdurabilitycostmining
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
Rückgabetyp: mods.contenttweaker.item.tool.ItemBuilderTool
ZenScript Copynew ItemBuilder().withMaxDamage(150).withType<ItemBuilderTool>().withDurabilityCostMining(durabilityCostMining as int);
new ItemBuilder().withMaxDamage(150).withType<ItemBuilderTool>().withDurabilityCostMining(1);
Parameter | Type | Beschreibung |
---|---|---|
Parameter durabilityCostMining | Type int | Beschreibung The damage points this item will receive |
withToolType
Link to withtooltype
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
Rückgabetyp: mods.contenttweaker.item.tool.ItemBuilderTool
ZenScript Copynew ItemBuilder().withMaxDamage(150).withType<ItemBuilderTool>().withToolType(toolType as mods.contenttweaker.item.MCToolType, miningLevel as int, miningSpeed as float);
new ItemBuilder().withMaxDamage(150).withType<ItemBuilderTool>().withToolType(<tooltype:shovel>, 3);
new ItemBuilder().withMaxDamage(150).withType<ItemBuilderTool>().withToolType(<tooltype:shovel>, 3, 2.0f);
Parameter | Type | Beschreibung | IsOptional | Standardwert |
---|---|---|---|---|
Parameter toolType | Type mods.contenttweaker.item.MCToolType | Beschreibung The type of the tool | IsOptional false | Standardwert null |
Parameter miningLevel | Type int | Beschreibung The mining level for this tool type | IsOptional false | Standardwert null |
Parameter miningSpeed | Type float | Beschreibung How fast this tool can mine blocks of the given type | IsOptional true | Standardwert 1.0 |