Interface WeaponUseHandler

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 WeaponUseHandler extends ItemHandler
This is triggered when a Player attacks an Entity.
Author:
Mooy1
  • Method Summary

    Modifier and Type
    Method
    Description
    default Class<? extends ItemHandler>
    This method returns the identifier for this ItemHandler.
    void
    onHit(org.bukkit.event.entity.EntityDamageByEntityEvent e, org.bukkit.entity.Player player, org.bukkit.inventory.ItemStack item)
    This function is called when an Player attacks an Entity with a SlimefunItem

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

    validate
  • Method Details

    • onHit

      void onHit(@Nonnull org.bukkit.event.entity.EntityDamageByEntityEvent e, @Nonnull org.bukkit.entity.Player player, @Nonnull org.bukkit.inventory.ItemStack item)
      This function is called when an Player attacks an Entity with a SlimefunItem
      Parameters:
      e - The EntityDamageByEntityEvent that was fired
      player - The Player that used the weapon
      item - The ItemStack that was used to attack
    • 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