public interface MobSpawner extends TileEntity
Modifier and Type | Method and Description |
---|---|
default MobSpawnerData |
getMobSpawnerData()
Gets the
MobSpawnerData for this mob spawner. |
default MutableBoundedValue<Short> |
maximumNearbyEntities()
Gets the
MutableBoundedValue for the limitation on the number
of nearby Entity instances can exist near the owning spawner. |
default MutableBoundedValue<Short> |
maximumSpawnDelay()
Gets the
MutableBoundedValue for the maximum spawn delay
required between attempts to spawn an Entity . |
default MutableBoundedValue<Short> |
minimumSpawnDelay()
Gets the
MutableBoundedValue for the minimum spawn delay
required between attempts to spawn an Entity . |
default Value<WeightedSerializableObject<EntityArchetype>> |
nextEntityToSpawn()
|
default WeightedCollectionValue<EntityArchetype> |
possibleEntitiesToSpawn()
Gets the
WeightedCollectionValue of all possible
Entity instances that can be spawned by the spawner. |
default MutableBoundedValue<Short> |
remainingDelay()
Gets the
MutableBoundedValue for the remaining delay before
a new attempt at spawning an Entity is made. |
default MutableBoundedValue<Short> |
requiredPlayerRange()
Gets the
MutableBoundedValue 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. |
default MutableBoundedValue<Short> |
spawnCount()
Gets the
MutableBoundedValue for the count of successful
spawns of all Entity instances from the owning spawner. |
void |
spawnEntityBatchImmediately(boolean force)
Trigger an immediate spawn of a batch of entities.
|
default MutableBoundedValue<Short> |
spawnRange()
Gets the
MutableBoundedValue for the maximum range that an
Entity can be spawned from the spawner. |
createArchetype, getBlock, getLocatableBlock, getType, isValid, setValid
setRawData, validateRawData
getContentVersion, toContainer
getApplicableProperties, getProperty
copyFrom, copyFrom, get, getContainers, getOrCreate, offer, offer, offer, offer, offer, offer, remove, remove, remove, require, supports, transform, tryOffer, tryOffer, tryOffer, tryOffer, undo
copy, get, getKeys, getOrElse, getOrNull, getValue, getValues, require, supports, supports
getLocation, getWorld
void spawnEntityBatchImmediately(boolean force)
This will obey the restrictions of maximum nearby entities and player
range unless the force
flag is set.
force
- Whether to ignore spawning restrictionsdefault MobSpawnerData getMobSpawnerData()
MobSpawnerData
for this mob spawner.default MutableBoundedValue<Short> remainingDelay()
MutableBoundedValue
for the remaining delay before
a new attempt at spawning an Entity
is made.default MutableBoundedValue<Short> minimumSpawnDelay()
MutableBoundedValue
for the minimum spawn delay
required between attempts to spawn an Entity
.default MutableBoundedValue<Short> maximumSpawnDelay()
MutableBoundedValue
for the maximum spawn delay
required between attempts to spawn an Entity
.default MutableBoundedValue<Short> spawnCount()
MutableBoundedValue
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
.default MutableBoundedValue<Short> maximumNearbyEntities()
MutableBoundedValue
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.default MutableBoundedValue<Short> requiredPlayerRange()
MutableBoundedValue
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.default MutableBoundedValue<Short> spawnRange()
MutableBoundedValue
for the maximum range that an
Entity
can be spawned from the spawner.default Value<WeightedSerializableObject<EntityArchetype>> nextEntityToSpawn()
Value
for the overridden
WeightedSerializableObject
<EntitySnapshot>
to spawn
next. If possible, the next entity to spawn may be chosen from the
already provided possibleEntitiesToSpawn()
.default WeightedCollectionValue<EntityArchetype> possibleEntitiesToSpawn()
WeightedCollectionValue
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()
.