Interface Tool.Builder

All Superinterfaces:
DataComponentBuilder<Tool>
Enclosing interface:
Tool

@Experimental @NonExtendable public static interface Tool.Builder extends DataComponentBuilder<Tool>
Builder for Tool.
  • Method Summary

    Modifier and Type
    Method
    Description
    Adds a rule to the tool that controls the breaking speed / damage per block if matched.
    Adds rules to the tool that control the breaking speed / damage per block if matched.
    damagePerBlock(@org.checkerframework.checker.index.qual.NonNegative int damage)
    Controls the amount of durability to remove each time a block is mined with this tool.
    defaultMiningSpeed(float miningSpeed)
    Controls mining speed to use if no rules match and don't override mining speed.

    Methods inherited from interface io.papermc.paper.datacomponent.DataComponentBuilder

    build
  • Method Details

    • damagePerBlock

      @Contract(value="_ -> this", mutates="this") Tool.Builder damagePerBlock(@org.checkerframework.checker.index.qual.NonNegative int damage)
      Controls the amount of durability to remove each time a block is mined with this tool.
      Parameters:
      damage - durability to remove
      Returns:
      the builder for chaining
      See Also:
    • defaultMiningSpeed

      @Contract(value="_ -> this", mutates="this") Tool.Builder defaultMiningSpeed(float miningSpeed)
      Controls mining speed to use if no rules match and don't override mining speed.
      Parameters:
      miningSpeed - mining speed
      Returns:
      the builder for chaining
      See Also:
    • addRule

      @Contract(value="_ -> this", mutates="this") Tool.Builder addRule(Tool.Rule rule)
      Adds a rule to the tool that controls the breaking speed / damage per block if matched.
      Parameters:
      rule - rule
      Returns:
      the builder for chaining
      See Also:
    • addRules

      @Contract(value="_ -> this", mutates="this") Tool.Builder addRules(Collection<Tool.Rule> rules)
      Adds rules to the tool that control the breaking speed / damage per block if matched.
      Parameters:
      rules - rules
      Returns:
      the builder for chaining
      See Also: