Package com.ranull.graves.listener
Class CreatureSpawnListener
java.lang.Object
com.ranull.graves.listener.CreatureSpawnListener
- All Implemented Interfaces:
org.bukkit.event.Listener
Listens for CreatureSpawnEvent to handle entity spawning data.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreatureSpawnListener
(Graves plugin) Constructs a new CreatureSpawnListener with the specified Graves plugin. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.
-
Field Details
-
plugin
-
-
Constructor Details
-
CreatureSpawnListener
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.
-