Interface Spawner

All Superinterfaces:
CopyableDataHolder, DataHolder, DataHolder.Mutable, DataSerializable, SerializableDataHolder, SerializableDataHolder.Mutable, ValueContainer
All Known Subinterfaces:
MobSpawner, SpawnerMinecart

public interface Spawner extends SerializableDataHolder.Mutable
Represents an object which can spawn Entities.

In vanilla this can be a MobSpawner or SpawnerMinecart.

  • Method Details

    • remainingDelay

      default Value.Mutable<Ticks> remainingDelay()
      Gets the Value.Mutable for the remaining delay before a new attempt at spawning an Entity is made.
      Returns:
      The immutable bounded value for the remaining delay
    • minimumSpawnDelay

      default Value.Mutable<Ticks> minimumSpawnDelay()
      Gets the Value.Mutable for the minimum spawn delay required between attempts to spawn an Entity.
      Returns:
      The bounded value of the minimum spawn delay
    • maximumSpawnDelay

      default Value.Mutable<Ticks> maximumSpawnDelay()
      Gets the Value.Mutable for the maximum spawn delay required between attempts to spawn an Entity.
      Returns:
      The bounded value of the maximum spawn delay
    • spawnCount

      default Value.Mutable<Integer> spawnCount()
      Gets the Value.Mutable for the count of successful spawns of all Entity instances from the owning spawner. This count is simply a total count, there is no limitation on how many attempts are made to spawn an Entity.
      Returns:
      The immutable bounded value
    • maximumNearbyEntities

      default Value.Mutable<Integer> maximumNearbyEntities()
      Gets the Value.Mutable for the limitation on the number of nearby Entity instances can exist near the owning spawner. The limitation is that if there are more Entity instances than the provided value, no attempts to spawn a new Entity will be made.
      Returns:
      The bounded value of the maximum supported nearby entities
    • requiredPlayerRange

      default Value.Mutable<Double> requiredPlayerRange()
      Gets the Value.Mutable for the minimum range a Player must remain in proximity of the spawner, such that if a Player is NOT within the provided range, no attempts to spawn an Entity is made.
      Returns:
      The value of the required player range to spawn entities
    • spawnRange

      default Value.Mutable<Double> spawnRange()
      Gets the Value.Mutable for the maximum range that an Entity can be spawned from the spawner.
      Returns:
      The immutable value of the maximum spawn range an entity can be spawned
    • nextEntityToSpawn

      Gets the Value.Mutable for the overridden WeightedSerializableObject<EntitySnapshot> to spawn next. If possible, the next entity to spawn may be chosen from the already provided possibleEntitiesToSpawn().
      Returns:
      The next possible entity to spawn
    • possibleEntitiesToSpawn

      default WeightedCollectionValue.Mutable<EntityArchetype> possibleEntitiesToSpawn()
      Gets the WeightedCollectionValue.Mutable of all possible Entity instances that can be spawned by the spawner. As they are all WeightedSerializableObject<EntitySnapshot> instances, their weight is defined as a Random to determine the next Entity that will be spawned, unless overriden by nextEntityToSpawn().
      Returns:
      The immutable weighted entity collection value of entities