Class ItemInteractionAuthenticator

java.lang.Object
io.github.djtpj.authenticator.Authenticator<T>
io.github.djtpj.authenticator.authenticators.PlayerAuthenticator<org.bukkit.event.player.PlayerInteractEvent>
io.github.djtpj.authenticator.authenticators.InteractAuthenticator
io.github.djtpj.authenticator.authenticators.ItemInteractionAuthenticator

public class ItemInteractionAuthenticator extends InteractAuthenticator
Authenticates an Item Interaction event if the player is holding a specific item
  • Constructor Details

    • ItemInteractionAuthenticator

      public ItemInteractionAuthenticator(org.bukkit.inventory.ItemStack[] items, boolean requiresSneaking, boolean requiresItem, SimpleTrait simpleTrait, org.bukkit.event.block.Action... actions)
      Parameters:
      items - the list of items that the player must hold one of
      requiresSneaking - whether the player needs to be sneaking
      requiresItem - whether the item must be non-placeable, edible, or interactable to trigger the event
      simpleTrait - the associated simpleTrait
      actions - the acceptable actions
    • ItemInteractionAuthenticator

      public ItemInteractionAuthenticator(org.bukkit.inventory.ItemStack item, boolean requiresSneaking, boolean requiresItem, SimpleTrait simpleTrait, org.bukkit.event.block.Action... actions)
      Parameters:
      item - the item the player must hold
      requiresSneaking - whether the player needs to be sneaking
      requiresItem - whether the item must be non-placeable, edible, or interactable to trigger the event
      simpleTrait - the associated simpleTrait
      actions - the acceptable actions
  • Method Details

    • authenticate

      public boolean authenticate(org.bukkit.event.player.PlayerInteractEvent event)
      Description copied from class: Authenticator
      Verifies weather a trait should run on an event
      Overrides:
      authenticate in class InteractAuthenticator
      Parameters:
      event - The event to authenticate
      Returns:
      whether a trait should run on this event