Class CreatureSpawnListener

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

public class CreatureSpawnListener extends Object implements org.bukkit.event.Listener
Listens for CreatureSpawnEvent to handle entity spawning data.
  • Field Summary

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

    Constructors
    Constructor
    Description
    Constructs a new CreatureSpawnListener with the specified Graves plugin.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onCreatureSpawn(org.bukkit.event.entity.CreatureSpawnEvent event)
    Handles CreatureSpawnEvent to store the spawn reason of the entity.
    private boolean
    shouldStoreSpawnReason(org.bukkit.event.entity.CreatureSpawnEvent event)
    Checks if the spawn reason of the entity should be stored.
    private void
    storeSpawnReason(org.bukkit.event.entity.CreatureSpawnEvent event)
    Stores the spawn reason of the entity.

    Methods inherited from class java.lang.Object

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

    • plugin

      private final Graves plugin
  • Constructor Details

    • CreatureSpawnListener

      public CreatureSpawnListener(Graves plugin)
      Constructs a new CreatureSpawnListener with the specified Graves plugin.
      Parameters:
      plugin - The Graves plugin instance.
  • Method Details

    • onCreatureSpawn

      public void onCreatureSpawn(org.bukkit.event.entity.CreatureSpawnEvent event)
      Handles CreatureSpawnEvent to store the spawn reason of the entity.
      Parameters:
      event - The CreatureSpawnEvent to handle.
    • shouldStoreSpawnReason

      private boolean shouldStoreSpawnReason(org.bukkit.event.entity.CreatureSpawnEvent event)
      Checks if the spawn reason of the entity should be stored.
      Parameters:
      event - The CreatureSpawnEvent.
      Returns:
      True if the spawn reason should be stored, false otherwise.
    • storeSpawnReason

      private void storeSpawnReason(org.bukkit.event.entity.CreatureSpawnEvent event)
      Stores the spawn reason of the entity.
      Parameters:
      event - The CreatureSpawnEvent.