Class TrialSpawner
java.lang.Object
net.minecraft.world.level.block.entity.trialspawner.TrialSpawner
- All Implemented Interfaces:
IOwnedSpawner
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic final recordstatic interface -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate TrialSpawner.FullConfigprivate final TrialSpawnerStateDataprivate static final intprivate static final intstatic final intprivate final PlayerDetector.EntitySelectorprivate booleanprivate static final org.slf4j.Loggerprivate static final intprivate static final intprivate booleanprivate PlayerDetectorprivate static final floatprivate final TrialSpawner.StateAccessor -
Constructor Summary
ConstructorsConstructorDescriptionTrialSpawner(TrialSpawner.FullConfig config, TrialSpawner.StateAccessor stateAccessor, PlayerDetector playerDetector, PlayerDetector.EntitySelector entitySelector) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddBecomeOminousParticles(Level level, BlockPos pos, RandomSource random) static voidaddDetectPlayerParticles(Level level, BlockPos pos, RandomSource random, int data, ParticleOptions type) static voidaddEjectItemParticles(Level level, BlockPos pos, RandomSource random) static voidaddSpawnParticles(Level level, BlockPos pos, RandomSource random, SimpleParticleType particleType) voidapplyOminous(ServerLevel level, BlockPos spawnerPos) booleancanSpawnInLevel(ServerLevel level) voidejectReward(ServerLevel level, BlockPos pos, ResourceKey<LootTable> ejectingLootTable) @Nullable Either<BlockEntity, Entity> getOwner()Returns the block entity or entity which owns this spawner object.intgetState()intprivate static booleaninLineOfSight(Level level, Vec3 origin, Vec3 dest) booleanvoidload(ValueInput input) voidvoidoverrideEntityToSpawn(EntityType<?> type, Level level) voidDeprecated, for removal: This API element is subject to removal in a future version.voidremoveOminous(ServerLevel level, BlockPos spawnerPos) voidsetPlayerDetector(PlayerDetector playerDetector) Deprecated, for removal: This API element is subject to removal in a future version.voidsetState(Level level, TrialSpawnerState state) private static booleanshouldMobBeUntracked(ServerLevel serverLevel, BlockPos spawnerPos, UUID id) spawnMob(ServerLevel level, BlockPos spawnerPos) voidstore(ValueOutput output) voidtickClient(Level level, BlockPos spawnerPos, boolean isOminous) voidtickServer(ServerLevel serverLevel, BlockPos spawnerPos, boolean isOminous)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
DETECT_PLAYER_SPAWN_BUFFER
public static final int DETECT_PLAYER_SPAWN_BUFFER- See Also:
-
DEFAULT_TARGET_COOLDOWN_LENGTH
private static final int DEFAULT_TARGET_COOLDOWN_LENGTH- See Also:
-
DEFAULT_PLAYER_SCAN_RANGE
private static final int DEFAULT_PLAYER_SCAN_RANGE- See Also:
-
MAX_MOB_TRACKING_DISTANCE
private static final int MAX_MOB_TRACKING_DISTANCE- See Also:
-
MAX_MOB_TRACKING_DISTANCE_SQR
private static final int MAX_MOB_TRACKING_DISTANCE_SQR -
SPAWNING_AMBIENT_SOUND_CHANCE
private static final float SPAWNING_AMBIENT_SOUND_CHANCE- See Also:
-
data
-
config
-
stateAccessor
-
playerDetector
-
entitySelector
-
overridePeacefulAndMobSpawnRule
private boolean overridePeacefulAndMobSpawnRule -
isOminous
private boolean isOminous
-
-
Constructor Details
-
TrialSpawner
public TrialSpawner(TrialSpawner.FullConfig config, TrialSpawner.StateAccessor stateAccessor, PlayerDetector playerDetector, PlayerDetector.EntitySelector entitySelector)
-
-
Method Details
-
activeConfig
-
normalConfig
-
ominousConfig
-
load
-
store
-
applyOminous
-
removeOminous
-
isOminous
public boolean isOminous() -
getTargetCooldownLength
public int getTargetCooldownLength() -
getRequiredPlayerRange
public int getRequiredPlayerRange() -
getState
-
getStateData
-
setState
-
markUpdated
public void markUpdated() -
getPlayerDetector
-
getEntitySelector
-
canSpawnInLevel
-
spawnMob
-
ejectReward
-
tickClient
-
tickServer
-
shouldMobBeUntracked
-
inLineOfSight
-
addSpawnParticles
public static void addSpawnParticles(Level level, BlockPos pos, RandomSource random, SimpleParticleType particleType) -
addBecomeOminousParticles
-
addDetectPlayerParticles
public static void addDetectPlayerParticles(Level level, BlockPos pos, RandomSource random, int data, ParticleOptions type) -
addEjectItemParticles
-
overrideEntityToSpawn
-
setPlayerDetector
Deprecated, for removal: This API element is subject to removal in a future version. -
overridePeacefulAndMobSpawnRule
Deprecated, for removal: This API element is subject to removal in a future version. -
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
-