Class NaturalSpawnTask

java.lang.Object
org.bukkit.scheduler.BukkitRunnable
valorless.rarespawns.world.NaturalSpawnTask
All Implemented Interfaces:
Runnable

public class NaturalSpawnTask extends org.bukkit.scheduler.BukkitRunnable
Scheduled task that proactively spawns rare entities near players, mimicking natural mob spawning without requiring a vanilla mob trigger.

This is the counterpart to SpawnEvent, intended for biomes/locations where vanilla spawning is sparse or absent (e.g. beaches, oceans, mushroom islands).

Runs every 400 ticks (~20 seconds) to match vanilla's spawn cycle cadence.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Registers and starts this task.
    void
    run()
     

    Methods inherited from class org.bukkit.scheduler.BukkitRunnable

    cancel, getTaskId, isCancelled, runTask, runTaskAsynchronously, runTaskLater, runTaskLaterAsynchronously, runTaskTimer, runTaskTimerAsynchronously

    Methods inherited from class java.lang.Object

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

    • NaturalSpawnTask

      public NaturalSpawnTask()
  • Method Details

    • init

      public static void init()
      Registers and starts this task. Should be called during plugin enable, after EntityCreator is initialised.
    • run

      public void run()