Package org.spongepowered.api.spawner
Interface Spawner
- All Superinterfaces:
CopyableDataHolder
,DataHolder
,DataHolder.Mutable
,DataSerializable
,SerializableDataHolder
,SerializableDataHolder.Mutable
,ValueContainer
- All Known Subinterfaces:
MobSpawner
,SpawnerMinecart
Represents an object which can spawn Entities.
In vanilla this can be a MobSpawner
or SpawnerMinecart
.
-
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
Modifier and TypeMethodDescriptiondefault Value.Mutable<Integer>
Gets theValue.Mutable
for the limitation on the number of nearbyEntity
instances can exist near the owning spawner.default Value.Mutable<Ticks>
Gets theValue.Mutable
for the maximum spawn delay required between attempts to spawn anEntity
.default Value.Mutable<Ticks>
Gets theValue.Mutable
for the minimum spawn delay required between attempts to spawn anEntity
.Gets theWeightedCollectionValue.Mutable
of all possibleEntity
instances that can be spawned by the spawner.default Value.Mutable<Ticks>
Gets theValue.Mutable
for the remaining delay before a new attempt at spawning anEntity
is made.default Value.Mutable<Double>
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>
Gets theValue.Mutable
for the count of successful spawns of allEntity
instances from the owning spawner.default Value.Mutable<Double>
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 Details
-
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
Gets theValue.Mutable
for the minimum spawn delay required between attempts to spawn anEntity
.- Returns:
- The bounded value of the minimum spawn delay
-
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
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
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
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
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
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
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 aRandomGenerator
to determine the nextEntity
that will be spawned, unless overriden bynextEntityToSpawn()
.- Returns:
- The immutable weighted entity collection value of entities
-