Package org.spongepowered.api.spawner
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
orSpawnerMinecart
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.spongepowered.api.data.DataHolder
DataHolder.Immutable<I extends DataHolder.Immutable<I>>, DataHolder.Mutable
-
Nested classes/interfaces inherited from interface org.spongepowered.api.data.SerializableDataHolder
SerializableDataHolder.Immutable<I extends SerializableDataHolder.Immutable<I>>, SerializableDataHolder.Mutable
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default Value.Mutable<Integer>
maximumNearbyEntities()
Gets theValue.Mutable
for the limitation on the number of nearbyEntity
instances can exist near the owning spawner.default Value.Mutable<Ticks>
maximumSpawnDelay()
Gets theValue.Mutable
for the maximum spawn delay required between attempts to spawn anEntity
.default Value.Mutable<Ticks>
minimumSpawnDelay()
Gets theValue.Mutable
for the minimum spawn delay required between attempts to spawn anEntity
.default Value.Mutable<WeightedSerializableObject<EntityArchetype>>
nextEntityToSpawn()
default WeightedCollectionValue.Mutable<EntityArchetype>
possibleEntitiesToSpawn()
Gets theWeightedCollectionValue.Mutable
of all possibleEntity
instances that can be spawned by the spawner.default Value.Mutable<Ticks>
remainingDelay()
Gets theValue.Mutable
for the remaining delay before a new attempt at spawning anEntity
is made.default Value.Mutable<Double>
requiredPlayerRange()
Gets theValue.Mutable
for the minimum range aPlayer
must remain in proximity of the spawner, such that if aPlayer
is NOT within the provided range, no attempts to spawn anEntity
is made.default Value.Mutable<Integer>
spawnCount()
Gets theValue.Mutable
for the count of successful spawns of allEntity
instances from the owning spawner.default Value.Mutable<Double>
spawnRange()
Gets theValue.Mutable
for the maximum range that anEntity
can be spawned from the spawner.-
Methods inherited from interface org.spongepowered.api.data.DataHolder.Mutable
copyFrom, copyFrom, offer, offer, offer, offer, offerAll, offerAll, offerAll, offerAll, offerAll, offerAll, offerSingle, offerSingle, offerSingle, offerSingle, remove, remove, remove, removeAll, removeAll, removeAll, removeAll, removeAll, removeAll, removeKey, removeKey, removeSingle, removeSingle, transform, transform, tryOffer, tryOffer, tryOffer, undo
-
Methods inherited from interface org.spongepowered.api.data.persistence.DataSerializable
contentVersion, toContainer
-
Methods inherited from interface org.spongepowered.api.data.SerializableDataHolder
validateRawData
-
Methods inherited from interface org.spongepowered.api.data.SerializableDataHolder.Mutable
copy, setRawData
-
-
-
-
Method Detail
-
remainingDelay
default Value.Mutable<Ticks> remainingDelay()
Gets theValue.Mutable
for the remaining delay before a new attempt at spawning anEntity
is made.- Returns:
- The immutable bounded value for the remaining delay
-
minimumSpawnDelay
default Value.Mutable<Ticks> minimumSpawnDelay()
Gets theValue.Mutable
for the minimum spawn delay required between attempts to spawn anEntity
.- Returns:
- The bounded value of the minimum spawn delay
-
maximumSpawnDelay
default Value.Mutable<Ticks> maximumSpawnDelay()
Gets theValue.Mutable
for the maximum spawn delay required between attempts to spawn anEntity
.- Returns:
- The bounded value of the maximum spawn delay
-
spawnCount
default Value.Mutable<Integer> spawnCount()
Gets theValue.Mutable
for the count of successful spawns of allEntity
instances from the owning spawner. This count is simply a total count, there is no limitation on how many attempts are made to spawn anEntity
.- Returns:
- The immutable bounded value
-
maximumNearbyEntities
default Value.Mutable<Integer> maximumNearbyEntities()
Gets theValue.Mutable
for the limitation on the number of nearbyEntity
instances can exist near the owning spawner. The limitation is that if there are moreEntity
instances than the provided value, no attempts to spawn a newEntity
will be made.- Returns:
- The bounded value of the maximum supported nearby entities
-
requiredPlayerRange
default Value.Mutable<Double> requiredPlayerRange()
Gets theValue.Mutable
for the minimum range aPlayer
must remain in proximity of the spawner, such that if aPlayer
is NOT within the provided range, no attempts to spawn anEntity
is made.- Returns:
- The value of the required player range to spawn entities
-
spawnRange
default Value.Mutable<Double> spawnRange()
Gets theValue.Mutable
for the maximum range that anEntity
can be spawned from the spawner.- Returns:
- The immutable value of the maximum spawn range an entity can be spawned
-
nextEntityToSpawn
default Value.Mutable<WeightedSerializableObject<EntityArchetype>> nextEntityToSpawn()
Gets theValue.Mutable
for the overriddenWeightedSerializableObject
<EntitySnapshot>
to spawn next. If possible, the next entity to spawn may be chosen from the already providedpossibleEntitiesToSpawn()
.- Returns:
- The next possible entity to spawn
-
possibleEntitiesToSpawn
default WeightedCollectionValue.Mutable<EntityArchetype> possibleEntitiesToSpawn()
Gets theWeightedCollectionValue.Mutable
of all possibleEntity
instances that can be spawned by the spawner. As they are allWeightedSerializableObject
<EntitySnapshot>
instances, their weight is defined as aRandom
to determine the nextEntity
that will be spawned, unless overriden bynextEntityToSpawn()
.- Returns:
- The immutable weighted entity collection value of entities
-
-