ItemBuilder
The item builder is to... build items (surprise!) It allows you to set various properties that will change how the item behaves and what it can do. Vous pouvez également utiliser mods.contenttweaker.item.ItemBuilder#withType pour passer à un constructeur plus spécialisé, s'il y en a. Pour dire à CoT que vous voulez que l'élément apparaisse en jeu, vous devez appeler mods.contenttweaker.item.ItemBuilder#build(String) et spécifier un chemin d'emplacement de ressource valide.
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.
Implemented Interfaces
ItemBuilder implements the following interfaces. That means any method available to them can also be used on this class.
Constructors
Creates a new ItemBuilder. Rappelez-vous que cela ne va pas créer un nouveau bloc dans le jeu, vous devez appeler mods.contenttweaker.item.ItemBuilder#build(String) pour cela.
Methods
build
Instructs CoT to actually build whatever this builder is supposed to be building.
withItemGroup
Allows you to set the item group that this item will appear in. By default, items will land in misc
Returns: This builder, used for method chaining
Type de retour : mods.contenttweaker.item.ItemBuilder
withMaxDamage
Vous permet de définir les dégâts maximaux pour cet objet.
Soyez averti que cela ne peut pas être utilisé en combinaison avec mods. ontenttweaker.item.ItemBuilder#withMaxStackSize!
Returns: This builder, used for method chaining
Type de retour : mods.contenttweaker.item.ItemBuilder
withMaxStackSize
Vous permet de définir la taille maximale de la pile pour cet objet.
Soyez averti que cela ne peut pas être utilisé en combinaison avec mods. ontenttweaker.item.ItemBuilder#withMaxDamage!
Returns: This builder, used for method chaining
Type de retour : mods.contenttweaker.item.ItemBuilder
withNoRepair
Sets that this item may not be repaired in an anvil Returns: This builder, used for method chaining
Type de retour : mods.contenttweaker.item.ItemBuilder
withRarity
Allows you to set the item's rarity
Returns: This builder, used for method chaining
Type de retour : mods.contenttweaker.item.ItemBuilder
withType
Sets the specific type of this item. After this method is called the builder's context will switch to the more provided type builder. That means that the methods of this builder will no longer be available, so any properties you wish to set should be set before you call this method. Returns: A builder with the given item.
Return type: T