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.MutableNested 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.Mutablefor the limitation on the number of nearbyEntityinstances can exist near the owning spawner.default Value.Mutable<Ticks> Gets theValue.Mutablefor the maximum spawn delay required between attempts to spawn anEntity.default Value.Mutable<Ticks> Gets theValue.Mutablefor the minimum spawn delay required between attempts to spawn anEntity.default Value.Mutable<EntityArchetype> Gets theWeightedCollectionValue.Mutableof all possibleEntityinstances that can be spawned by the spawner.default Value.Mutable<Ticks> Gets theValue.Mutablefor the remaining delay before a new attempt at spawning anEntityis made.default Value.Mutable<Double> Gets theValue.Mutablefor the minimum range aPlayermust remain in proximity of the spawner, such that if aPlayeris NOT within the provided range, no attempts to spawn anEntityis made.default Value.Mutable<Integer> Gets theValue.Mutablefor the count of successful spawns of allEntityinstances from the owning spawner.default Value.Mutable<Double> Gets theValue.Mutablefor the maximum range that anEntitycan 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, undoMethods inherited from interface org.spongepowered.api.data.persistence.DataSerializable
contentVersion, toContainerMethods inherited from interface org.spongepowered.api.data.SerializableDataHolder
validateRawDataMethods inherited from interface org.spongepowered.api.data.SerializableDataHolder.Mutable
copy, setRawData
-
Method Details
-
remainingDelay
Gets theValue.Mutablefor the remaining delay before a new attempt at spawning anEntityis made.- Returns:
- The immutable bounded value for the remaining delay
-
minimumSpawnDelay
Gets theValue.Mutablefor the minimum spawn delay required between attempts to spawn anEntity.- Returns:
- The bounded value of the minimum spawn delay
-
maximumSpawnDelay
Gets theValue.Mutablefor the maximum spawn delay required between attempts to spawn anEntity.- Returns:
- The bounded value of the maximum spawn delay
-
spawnCount
Gets theValue.Mutablefor the count of successful spawns of allEntityinstances 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.Mutablefor the limitation on the number of nearbyEntityinstances can exist near the owning spawner. The limitation is that if there are moreEntityinstances than the provided value, no attempts to spawn a newEntitywill be made.- Returns:
- The bounded value of the maximum supported nearby entities
-
requiredPlayerRange
Gets theValue.Mutablefor the minimum range aPlayermust remain in proximity of the spawner, such that if aPlayeris NOT within the provided range, no attempts to spawn anEntityis made.- Returns:
- The value of the required player range to spawn entities
-
spawnRange
Gets theValue.Mutablefor the maximum range that anEntitycan be spawned from the spawner.- Returns:
- The immutable value of the maximum spawn range an entity can be spawned
-
nextEntityToSpawn
Gets theValue.Mutablefor 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.Mutableof all possibleEntityinstances that can be spawned by the spawner. As they are allWeightedSerializableObject<EntitySnapshot>instances, their weight is defined as aRandomGeneratorto determine the nextEntitythat will be spawned, unless overriden bynextEntityToSpawn().- Returns:
- The immutable weighted entity collection value of entities
-