Interface ToolUseHandler

All Superinterfaces:
ItemHandler
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ToolUseHandler extends ItemHandler
This ItemHandler is called when a Block is broken with a SlimefunItem as its tool.
Author:
TheBusyBiscuit
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    default Class<? extends ItemHandler>
    This method returns the identifier for this ItemHandler.
    void
    onToolUse(org.bukkit.event.block.BlockBreakEvent e, org.bukkit.inventory.ItemStack tool, int fortune, List<org.bukkit.inventory.ItemStack> drops)
    This method is called whenever a BlockBreakEvent was fired when using this SlimefunItem to break a Block.

    Methods inherited from interface io.github.thebusybiscuit.slimefun4.api.items.ItemHandler

    validate
  • Method Details

    • onToolUse

      void onToolUse(org.bukkit.event.block.BlockBreakEvent e, org.bukkit.inventory.ItemStack tool, int fortune, List<org.bukkit.inventory.ItemStack> drops)
      This method is called whenever a BlockBreakEvent was fired when using this SlimefunItem to break a Block.
      Parameters:
      e - The BlockBreakEvent
      tool - The tool that was used
      fortune - The amount of bonus drops to be expected from the fortune Enchantment.
      drops - The dropped items
    • getIdentifier

      default Class<? extends ItemHandler> getIdentifier()
      Description copied from interface: ItemHandler
      This method returns the identifier for this ItemHandler. We use a Class identifier to group Item Handlers together.
      Specified by:
      getIdentifier in interface ItemHandler
      Returns:
      The Class identifier for this ItemHandler