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 pConfig, TrialSpawner.StateAccessor pStateAccessor, PlayerDetector pPlayerDetector, PlayerDetector.EntitySelector pEntitySelector) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddBecomeOminousParticles(Level pLevel, BlockPos pPos, RandomSource pRandom) static voidaddDetectPlayerParticles(Level pLevel, BlockPos pPos, RandomSource pRandom, int pType, ParticleOptions pParticle) static voidaddEjectItemParticles(Level pLevel, BlockPos pPos, RandomSource pRandom) static voidaddSpawnParticles(Level pLevel, BlockPos pPos, RandomSource pRandom, SimpleParticleType pParticleType) voidapplyOminous(ServerLevel pLevel, BlockPos pPos) booleancanSpawnInLevel(ServerLevel pLevel) voidejectReward(ServerLevel pLevel, BlockPos pPos, ResourceKey<LootTable> pLootTable) com.mojang.datafixers.util.Either<BlockEntity, Entity> getOwner()Returns the block entity or entity which owns this spawner object.intgetState()intprivate static booleaninLineOfSight(Level pLevel, Vec3 pSpawnerPos, Vec3 pMobPos) booleanvoidload(ValueInput pInput) voidvoidoverrideEntityToSpawn(EntityType<?> pEntityType, Level pLevel) voidDeprecated, for removal: This API element is subject to removal in a future version.voidremoveOminous(ServerLevel pLevel, BlockPos pPos) voidsetPlayerDetector(PlayerDetector pPlayerDetector) Deprecated, for removal: This API element is subject to removal in a future version.voidsetState(Level pLevel, TrialSpawnerState pState) private static booleanshouldMobBeUntracked(ServerLevel pLevel, BlockPos pPos, UUID pUuid) spawnMob(ServerLevel pLevel, BlockPos pPos) voidstore(ValueOutput pOutput) voidtickClient(Level pLevel, BlockPos pPos, boolean pIsOminous) voidtickServer(ServerLevel pLevel, BlockPos pPos, boolean pIsOminous)
-
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 pConfig, TrialSpawner.StateAccessor pStateAccessor, PlayerDetector pPlayerDetector, PlayerDetector.EntitySelector pEntitySelector)
-
-
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 pLevel, BlockPos pPos, RandomSource pRandom, SimpleParticleType pParticleType) -
addBecomeOminousParticles
-
addDetectPlayerParticles
public static void addDetectPlayerParticles(Level pLevel, BlockPos pPos, RandomSource pRandom, int pType, ParticleOptions pParticle) -
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
-