Package cn.nukkit.item.customitem
Class CustomItemDefinition.ToolBuilder
java.lang.Object
cn.nukkit.item.customitem.CustomItemDefinition.SimpleBuilder
cn.nukkit.item.customitem.CustomItemDefinition.ToolBuilder
- Enclosing class:
- CustomItemDefinition
-
Field Summary
Fields inherited from class cn.nukkit.item.customitem.CustomItemDefinition.SimpleBuilder
identifier, nbt
-
Method Summary
Modifier and TypeMethodDescriptionaddExtraBlock
(String blockName, int speed) 给工具添加可挖掘的方块,及挖掘它的速度addExtraBlocks
(String blockName, DigProperty property) 给工具添加可挖掘的方块,及挖掘它的速度addExtraBlocks
(Map<String, Integer> blocks) 给工具添加可挖掘的方块,及挖掘它的速度addExtraBlockTags
(List<String> blockTags) 给工具添加可挖掘的一类方块,用blockTag描述,挖掘它们的速度为speed(int)
的速度,如果没定义则为工具TIER对应的速度addRepairItemName
(@NonNull String repairItemName, int repairAmount) addRepairItemName
(@NonNull String repairItemName, String molang) addRepairItems
(List<Item> repairItems, int repairAmount) addRepairItems
(List<Item> repairItems, String molang) build()
isWeapon()
物品的攻击力必须大于0才能生效speed
(int speed) 控制采集类工具的挖掘速度Methods inherited from class cn.nukkit.item.customitem.CustomItemDefinition.SimpleBuilder
addRepairs, allowOffHand, calculateID, canDestroyInCreative, creativeGroup, customBuild, foil, handEquipped, renderOffsets, tag
-
Field Details
-
toolBlocks
-
-
Method Details
-
addRepairItemName
@Since("1.19.60-r1") public CustomItemDefinition.ToolBuilder addRepairItemName(@NonNull @NonNull String repairItemName, String molang) -
addRepairItemName
@Since("1.19.60-r1") public CustomItemDefinition.ToolBuilder addRepairItemName(@NonNull @NonNull String repairItemName, int repairAmount) -
addRepairItems
@Since("1.19.40-r1") public CustomItemDefinition.ToolBuilder addRepairItems(@NotNull List<Item> repairItems, String molang) -
addRepairItems
@Since("1.19.40-r1") public CustomItemDefinition.ToolBuilder addRepairItems(@NotNull List<Item> repairItems, int repairAmount) -
speed
控制采集类工具的挖掘速度- Parameters:
speed
- 挖掘速度
-
addExtraBlock
@Since("1.19.60-r1") public CustomItemDefinition.ToolBuilder addExtraBlock(@NotNull String blockName, int speed) 给工具添加可挖掘的方块,及挖掘它的速度Add a diggable block to the tool and define dig speed
- Parameters:
blockName
- the block namespeed
- 挖掘速度- Returns:
- the tool builder
-
addExtraBlocks
@Since("1.19.60-r1") public CustomItemDefinition.ToolBuilder addExtraBlocks(@NotNull Map<String, Integer> blocks) 给工具添加可挖掘的方块,及挖掘它的速度Add a diggable block to the tool and define dig speed
- Parameters:
blocks
- the blocks- Returns:
- the tool builder
-
addExtraBlocks
@Since("1.19.60-r1") public CustomItemDefinition.ToolBuilder addExtraBlocks(@NotNull String blockName, DigProperty property) 给工具添加可挖掘的方块,及挖掘它的速度Add a diggable block to the tool and define dig speed
- Parameters:
blockName
- the block nameproperty
- the property- Returns:
- the tool builder
-
isWeapon
物品的攻击力必须大于0才能生效标记这个物品是否为武器,如果是,会在物品描述中提示
"+X 攻击伤害"
的信息The item's attack damage must be greater than 0
define the item is a weapon or not, and if so, it will prompt
"+X attack damage"
in the item description -
addExtraBlockTags
@Since("1.19.60-r1") public CustomItemDefinition.ToolBuilder addExtraBlockTags(@NotNull List<String> blockTags) 给工具添加可挖掘的一类方块,用blockTag描述,挖掘它们的速度为speed(int)
的速度,如果没定义则为工具TIER对应的速度Add a class of block to the tool that can be mined, described by blockTag, and the speed to mine them is the speed of
speed(int)
, or the speed corresponding to the tool TIER if it is not defined- Parameters:
blockTags
- 挖掘速度- Returns:
- the tool builder
-
build
- Overrides:
build
in classCustomItemDefinition.SimpleBuilder
-