Class EntityDamageListener

java.lang.Object
com.ranull.graves.listener.integration.nexo.EntityDamageListener
All Implemented Interfaces:
org.bukkit.event.Listener

public class EntityDamageListener extends Object implements org.bukkit.event.Listener
Listens for EntityDamageEvent and cancels damage if the entity is an ItemFrame associated with a grave.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final Nexo
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new EntityDamageListener with the specified Nexo instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    private boolean
    isItemFrameAndHasGrave(org.bukkit.event.entity.EntityDamageEvent event)
    Checks if the entity is an ItemFrame and has an associated grave.
    void
    onEntityDamage(org.bukkit.event.entity.EntityDamageEvent event)
    Handles EntityDamageEvent.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • nexo

      private final Nexo nexo
  • Constructor Details

    • EntityDamageListener

      public EntityDamageListener(Nexo nexo)
      Constructs a new EntityDamageListener with the specified Nexo instance.
      Parameters:
      nexo - The Nexo instance to use.
  • Method Details

    • onEntityDamage

      public void onEntityDamage(org.bukkit.event.entity.EntityDamageEvent event)
      Handles EntityDamageEvent. If the entity being damaged is an ItemFrame and is associated with a grave, it cancels the damage event.
      Parameters:
      event - The EntityDamageEvent to handle.
    • isItemFrameAndHasGrave

      private boolean isItemFrameAndHasGrave(org.bukkit.event.entity.EntityDamageEvent event)
      Checks if the entity is an ItemFrame and has an associated grave.
      Parameters:
      event - The EntityDamageEvent.
      Returns:
      True if the entity is an ItemFrame and has an associated grave, false otherwise.