Package net.minecraft.world.level
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 EntityCached instance of the entity to render inside the spawner.private static final intprivate intprivate intprivate intprivate SpawnDataprivate doubleprivate intstatic final Stringprivate intprivate intprivate WeightedList<SpawnData> private intprivate double -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidbroadcastEvent(Level pLevel, BlockPos pPos, int pEventId) voidclientTick(Level pLevel, BlockPos pPos) private voidgetOrCreateDisplayEntity(Level pLevel, BlockPos pPos) private SpawnDatagetOrCreateNextSpawnData(Level pLevel, RandomSource pRandom, BlockPos pPos) doublegetoSpin()com.mojang.datafixers.util.Either<BlockEntity, Entity> getOwner()Returns the block entity or entity which owns this spawner object.doublegetSpin()private booleanisNearPlayer(Level pLevel, BlockPos pPos) voidload(Level pLevel, BlockPos pPos, CompoundTag pTag) booleanonEventTriggered(Level pLevel, int pId) save(CompoundTag pTag) voidserverTick(ServerLevel pServerLevel, BlockPos pPos) voidsetEntityId(EntityType<?> pType, Level pLevel, RandomSource pRandom, BlockPos pPos) protected voidsetNextSpawnData(Level pLevel, BlockPos pPos, SpawnData pNextSpawnData)
-
Field Details
-
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<?> pType, @Nullable Level pLevel, RandomSource pRandom, BlockPos pPos) -
isNearPlayer
-
clientTick
-
serverTick
-
delay
-
load
-
save
-
getOrCreateDisplayEntity
-
onEventTriggered
-
setNextSpawnData
-
getOrCreateNextSpawnData
private SpawnData getOrCreateNextSpawnData(@Nullable Level pLevel, RandomSource pRandom, BlockPos pPos) -
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
-