Class EntityAttemptSmashAttackEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.entity.EntityEvent
io.papermc.paper.event.entity.EntityAttemptSmashAttackEvent

@NullMarked public class EntityAttemptSmashAttackEvent extends EntityEvent
Called when an entity attempts to perform a smash attack.
  • Constructor Details

  • Method Details

    • getTarget

      public LivingEntity getTarget()
      Yields the target of the attempted smash attack.
      Returns:
      the target entity
    • getWeapon

      public ItemStack getWeapon()
      Yields a copy of the itemstack used in the smash attack attempt.
      Returns:
      the itemstack
    • getOriginalResult

      public boolean getOriginalResult()
      Yields the original result the server computed.
      Returns:
      true if this attempt would have been successful by vanilla's logic, false otherwise.
    • getResult

      public Event.Result getResult()
      Yields the effective result of this event. The result may take one of three values:
      Returns:
      the result.
    • setResult

      public void setResult(Event.Result result)
      Configures a new result for this event. The passes result may take one of three values:
      Parameters:
      result - the new result of the event.
    • getHandlers

      public HandlerList getHandlers()
      Specified by:
      getHandlers in class Event
    • getHandlerList

      public static HandlerList getHandlerList()