Class BaseSpawner
java.lang.Object
net.minecraft.world.level.BaseSpawner
- All Implemented Interfaces:
IOwnedSpawner
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate @Nullable EntityCached instance of the entity to render inside the spawner.private static final intprivate static final org.slf4j.Loggerprivate intprivate intprivate intprivate @Nullable SpawnDataprivate doubleprivate intstatic final Stringprivate intprivate intprivate WeightedList<SpawnData> private intprivate double -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidbroadcastEvent(Level level, BlockPos pos, int id) voidclientTick(Level level, BlockPos pos) private void@Nullable EntitygetOrCreateDisplayEntity(Level level, BlockPos pos) private SpawnDatagetOrCreateNextSpawnData(@Nullable Level level, RandomSource random, BlockPos pos) doublegetOSpin()@Nullable com.mojang.datafixers.util.Either<BlockEntity, Entity> getOwner()Returns the block entity or entity which owns this spawner object.doublegetSpin()private booleanisNearPlayer(Level level, BlockPos pos) voidload(@Nullable Level level, BlockPos pos, ValueInput input) booleanonEventTriggered(Level level, int id) voidsave(ValueOutput output) voidserverTick(ServerLevel level, BlockPos pos) voidsetEntityId(EntityType<?> type, @Nullable Level level, RandomSource random, BlockPos pos) protected voidsetNextSpawnData(@Nullable Level level, BlockPos pos, SpawnData nextSpawnData)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
SPAWN_DATA_TAG
- See Also:
-
EVENT_SPAWN
private static final int EVENT_SPAWN- See Also:
-
DEFAULT_SPAWN_DELAY
private static final int DEFAULT_SPAWN_DELAY- See Also:
-
DEFAULT_MIN_SPAWN_DELAY
private static final int DEFAULT_MIN_SPAWN_DELAY- See Also:
-
DEFAULT_MAX_SPAWN_DELAY
private static final int DEFAULT_MAX_SPAWN_DELAY- See Also:
-
DEFAULT_SPAWN_COUNT
private static final int DEFAULT_SPAWN_COUNT- See Also:
-
DEFAULT_MAX_NEARBY_ENTITIES
private static final int DEFAULT_MAX_NEARBY_ENTITIES- See Also:
-
DEFAULT_REQUIRED_PLAYER_RANGE
private static final int DEFAULT_REQUIRED_PLAYER_RANGE- See Also:
-
DEFAULT_SPAWN_RANGE
private static final int DEFAULT_SPAWN_RANGE- See Also:
-
spawnDelay
private int spawnDelay -
spawnPotentials
-
nextSpawnData
-
spin
private double spin -
oSpin
private double oSpin -
minSpawnDelay
private int minSpawnDelay -
maxSpawnDelay
private int maxSpawnDelay -
spawnCount
private int spawnCount -
displayEntity
Cached instance of the entity to render inside the spawner. -
maxNearbyEntities
private int maxNearbyEntities -
requiredPlayerRange
private int requiredPlayerRange -
spawnRange
private int spawnRange
-
-
Constructor Details
-
BaseSpawner
public BaseSpawner()
-
-
Method Details
-
setEntityId
public void setEntityId(EntityType<?> type, @Nullable Level level, RandomSource random, BlockPos pos) -
isNearPlayer
-
clientTick
-
serverTick
-
delay
-
load
-
save
-
getOrCreateDisplayEntity
-
onEventTriggered
-
setNextSpawnData
-
getOrCreateNextSpawnData
private SpawnData getOrCreateNextSpawnData(@Nullable Level level, RandomSource random, BlockPos pos) -
broadcastEvent
-
getSpin
public double getSpin() -
getOSpin
public double getOSpin() -
getOwner
Description copied from interface:IOwnedSpawnerReturns the block entity or entity which owns this spawner object.For a
BaseSpawner, this is theorinvalid reference
MobSpawnerBlockEntityMinecartSpawner.For a
TrialSpawner, this is theTrialSpawnerBlockEntity.- Specified by:
getOwnerin interfaceIOwnedSpawner
-