public interface JavaTool
The tool component can be used to mark if the item can destroy blocks when used in creative mode. For non-vanilla items, it is also important to set a default mining speed and all the rules the tool has to ensure proper block breaking. For vanilla-item overrides, Geyser is able to handle this automatically.
Since:
2.9.3
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Builder for the tool component.
    static interface 
    A rule for a tool.
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates a builder for the tool component.
    boolean
    Whether this item can destroy blocks when trying to break them in creative mode.
    @org.checkerframework.checker.index.qual.Positive float
    The default mining speed of the tool.
    static JavaTool
    of(boolean canDestroyBlocksInCreative)
    Creates a tool component, without any rules or a default mining speed.
    A list of rules this tool has.
  • Method Details

    • rules

      A list of rules this tool has. A tool rule consists of a Holders of block identifiers, and the break speed for those blocks. Doesn't have to be set for vanilla-item overrides.
      Returns:
      a list of rules this tool has
      Since:
      2.9.3
    • defaultMiningSpeed

      @org.checkerframework.checker.index.qual.Positive float defaultMiningSpeed()
      The default mining speed of the tool. This speed is used when no rules match when breaking a block. Defaults to 0.0, and doesn't have to be set for vanilla-item overrides.
      Returns:
      the default mining speed of the tool
      Since:
      2.9.3
    • canDestroyBlocksInCreative

      boolean canDestroyBlocksInCreative()
      Whether this item can destroy blocks when trying to break them in creative mode. Defaults to true.
      Returns:
      whether this item can destroy blocks in creative mode
      Since:
      2.9.3
    • builder

      static JavaTool.Builder builder()
      Creates a builder for the tool component.
      Returns:
      a new builder
      Since:
      2.9.3
    • of

      static JavaTool of(boolean canDestroyBlocksInCreative)
      Creates a tool component, without any rules or a default mining speed. This should only be used for vanilla-item overrides.
      Parameters:
      canDestroyBlocksInCreative - determines if the item will break blocks in creative mode
      Returns:
      a tool component
      Since:
      2.9.3