Class SpawnEntityListener
java.lang.Object
dev.satyrn.deepcavespiders.listeners.SpawnEntityListener
- All Implemented Interfaces:
org.bukkit.event.Listener
Spawns cave spiders according to configuration.
- Since:
- 1.0-SNAPSHOT
- Author:
- Isabel Maskrey
-
Constructor Summary
ConstructorsConstructorDescriptionSpawnEntityListener(@NotNull org.bukkit.plugin.Plugin plugin, @NotNull Configuration configuration) -
Method Summary
Modifier and TypeMethodDescriptiondoublegetSpawnChance(org.bukkit.Difficulty difficulty, double y) Gets the spawn chance for a specific difficulty.voidonSpawnCaveSpider(org.bukkit.event.entity.CreatureSpawnEvent event) Handles creature spawn events for cave spiders.voidonSpawnSpider(org.bukkit.event.entity.CreatureSpawnEvent event) Handles creature spawn events for spiders.
-
Constructor Details
-
SpawnEntityListener
public SpawnEntityListener(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, @NotNull @NotNull Configuration configuration)
-
-
Method Details
-
onSpawnSpider
public void onSpawnSpider(org.bukkit.event.entity.CreatureSpawnEvent event) Handles creature spawn events for spiders.- Parameters:
event- The event.
-
onSpawnCaveSpider
public void onSpawnCaveSpider(org.bukkit.event.entity.CreatureSpawnEvent event) Handles creature spawn events for cave spiders.- Parameters:
event- The event.
-
getSpawnChance
public double getSpawnChance(org.bukkit.Difficulty difficulty, double y) Gets the spawn chance for a specific difficulty.- Parameters:
difficulty- The world difficulty.y- The Y location of the spawn. Used if spawn distribution is not set to CONSTANT.- Returns:
- The spawn chance for the given difficulty.
-