# 接口的使用
org.bukkit.inventory.meta.components.ToolComponent.ToolRule

使用ToolComponent.ToolRule的程序包
程序包
说明
org.bukkit.inventory.meta.components
Isolated components which may form part of item meta.

- ## org.bukkit.inventory.meta.components中ToolComponent.ToolRule的使用

  返回ToolComponent.ToolRule的org.bukkit.inventory.meta.components中的方法
  修饰符和类型
  方法
  说明
  `@NotNull ToolComponent.ToolRule`
  ToolComponent.`addRule(@NotNull Collection<Material> blocks, @Nullable Float speed, @Nullable Boolean correctForDrops)`
  Add a new rule to this tool component, which provides further information about a collection of block types.
  `@NotNull ToolComponent.ToolRule`
  ToolComponent.`addRule(@NotNull Material block, @Nullable Float speed, @Nullable Boolean correctForDrops)`
  Add a new rule to this tool component, which provides further information about a specific block type.
  `@NotNull ToolComponent.ToolRule`
  ToolComponent.`addRule(@NotNull Tag<Material> tag, @Nullable Float speed, @Nullable Boolean correctForDrops)`
  Add a new rule to this tool component, which provides further information about a collection of block types represented by a block `Tag`.
  返回变量类型为ToolComponent.ToolRule的类型的org.bukkit.inventory.meta.components中的方法
  修饰符和类型
  方法
  说明
  `@NotNull List<ToolComponent.ToolRule>`
  ToolComponent.`getRules()`
  Get the list of `ToolRules` that apply to this tool.
  参数类型为ToolComponent.ToolRule的org.bukkit.inventory.meta.components中的方法
  修饰符和类型
  方法
  说明
  `boolean`
  ToolComponent.`removeRule(@NotNull ToolComponent.ToolRule rule)`
  Remove the given `ToolComponent.ToolRule` from this tool.
  类型变量类型为ToolComponent.ToolRule的org.bukkit.inventory.meta.components中的方法参数
  修饰符和类型
  方法
  说明
  `void`
  ToolComponent.`setRules(@NotNull List<ToolComponent.ToolRule> rules)`
  Set the list of `ToolRules` to apply to this tool.