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. È anche possibile utilizzare mods.contenttweaker.item.ItemBuilder#withType per passare a un costruttore più specializzato, se ce ne sono. Per dire a CoT che vuoi che l'elemento appaia in ingame devi chiamare mods.contenttweaker.item.ItemBuilder#build(String) e specificare un percorso di localizzazione delle risorse valido.
This class was added by a mod with mod-id contenttweaker
. Perciò, è necessario avere questa mod installata per poter utilizzare questa funzione.
Importing the class
Potrebbe essere necessario importare il pacchetto, se si incontrano dei problemi (come castare un vettore), quindi meglio essere sicuri e aggiungere la direttiva di importazione.
Interfacce Implementate
ItemBuilder implements the following interfaces. Ciò significa che ogni metodo presente nell'interfaccia può essere usato anche per questa classe.
Constructors
Creates a new ItemBuilder. Ricorda che questo non creerà un nuovo blocco nel gioco, è necessario chiamare mods.contenttweaker.item.ItemBuilder#build(String) per questo.
Methods
build
Istruisce CoT per costruire realmente qualsiasi cosa il costruttore dovrebbe star costruendo.
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
Tipo restituito: mods.contenttweaker.item.ItemBuilder
withMaxDamage
Ti permette di impostare il danno massimo per questo oggetto.
Sii avvertito che questo non può essere usato in combinazione con mod. ontenttweaker.item.ItemBuilder#withMaxStackSize!
Returns: This builder, used for method chaining
Tipo restituito: mods.contenttweaker.item.ItemBuilder
withMaxStackSize
Permette di impostare la dimensione massima dello stack per questo oggetto.
Sii avvertito che questo non può essere usato in combinazione con mod. ontenttweaker.item.ItemBuilder#withMaxDamage!
Returns: This builder, used for method chaining
Tipo restituito: mods.contenttweaker.item.ItemBuilder
withNoRepair
Sets that this item may not be repaired in an anvil Returns: This builder, used for method chaining
Tipo restituito: mods.contenttweaker.item.ItemBuilder
withRarity
Allows you to set the item's rarity
Returns: This builder, used for method chaining
Tipo restituito: 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