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. 您也可以使用 mods.contenttweeper.itemBuilder#withType 切换到更专业化的构建器,如果存在任何构建器。 要告诉Cot, 你想要这个项目出现在新手中, 你需要调用 mods.contenttweeper.itemBuilder#build(String) 并指定一个有效的资源位置路径.
This class was added by a mod with mod-id contenttweaker
. 因此,如果要使用此功能,则需要安装此mod。
导入相关包
如果遇到任何问题(例如强制转换数组),则可能需要导入软件包,因此,最好的方式就是导入包支持。
已实现的接口
ItemBuilder implements the following interfaces. 这意味着对这个接口可用的任何方法也可以在此类上使用。
Constructor #构造函数
Creates a new ItemBuilder. 请记住,这将 不是 在游戏中创建一个新的块,为此你需要调用 mods.contenttweeper.itemBuilder#build(String)。
方法
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
返回类型: mods.contenttweiner.item.ItemBuilder
withMaxDamage
允许您设置此物品的最大伤害。
请注意,此选项不能与 mod结合使用。 ontentinstruer.itemBuilder#withMaxStackSize!
Returns: This builder, used for method chaining
返回类型: mods.contenttweiner.item.ItemBuilder
withMaxStackSize
允许您设置此项目的最大堆栈大小。
请注意,此选项不能与 mod结合使用。 ontentinstruer.item.ItemBuilder#withMaxDamage!
Returns: This builder, used for method chaining
返回类型: mods.contenttweiner.item.ItemBuilder
withNoRepair
Sets that this item may not be repaired in an anvil Returns: This builder, used for method chaining
返回类型: mods.contenttweiner.item.ItemBuilder
withRarity
Allows you to set the item's rarity
Returns: This builder, used for method chaining
返回类型: mods.contenttweiner.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