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 interface -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final TrialSpawnerDataprivate static final intprivate static final intstatic final intprivate final PlayerDetector.EntitySelectorprivate booleanprivate static final intprivate static final intstatic final Stringprivate final TrialSpawnerConfigstatic final Stringprivate final TrialSpawnerConfigprivate booleanprivate PlayerDetectorprivate final intprivate static final floatprivate final TrialSpawner.StateAccessorprivate final int -
Constructor Summary
ConstructorsConstructorDescriptionTrialSpawner(TrialSpawner.StateAccessor stateAccessor, PlayerDetector playerDetector, PlayerDetector.EntitySelector entitySelector) TrialSpawner(TrialSpawnerConfig normalConfig, TrialSpawnerConfig ominousConfig, TrialSpawnerData data, int targetCooldownLength, int requiredPlayerRange, 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 type, ParticleOptions particle) static voidaddEjectItemParticles(Level level, BlockPos pos, RandomSource random) static voidaddSpawnParticles(Level level, BlockPos pos, RandomSource random, SimpleParticleType particleType) voidapplyOminous(ServerLevel level, BlockPos pos) booleancanSpawnInLevel(Level level) com.mojang.serialization.Codec<TrialSpawner> codec()voidejectReward(ServerLevel level, BlockPos pos, ResourceKey<LootTable> lootTable) getData()private TrialSpawnerConfigcom.mojang.datafixers.util.Either<BlockEntity, Entity> getOwner()Returns the block entity or entity which owns this spawner object.intgetState()intprivate static booleaninLineOfSight(Level level, Vec3 spawnerPos, Vec3 mobPos) booleanvoidvoidDeprecated, for removal: This API element is subject to removal in a future version.voidremoveOminous(ServerLevel level, BlockPos pos) 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 level, BlockPos pos, UUID uuid) spawnMob(ServerLevel level, BlockPos pos) voidtickClient(Level level, BlockPos pos, boolean isOminous) voidtickServer(ServerLevel level, BlockPos pos, boolean isOminous)
-
Field Details
-
NORMAL_CONFIG_TAG_NAME
- See Also:
-
OMINOUS_CONFIG_TAG_NAME
- See Also:
-
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:
-
normalConfig
-
ominousConfig
-
data
-
requiredPlayerRange
private final int requiredPlayerRange -
targetCooldownLength
private final int targetCooldownLength -
stateAccessor
-
playerDetector
-
entitySelector
-
overridePeacefulAndMobSpawnRule
private boolean overridePeacefulAndMobSpawnRule -
isOminous
private boolean isOminous
-
-
Constructor Details
-
TrialSpawner
public TrialSpawner(TrialSpawner.StateAccessor stateAccessor, PlayerDetector playerDetector, PlayerDetector.EntitySelector entitySelector) -
TrialSpawner
public TrialSpawner(TrialSpawnerConfig normalConfig, TrialSpawnerConfig ominousConfig, TrialSpawnerData data, int targetCooldownLength, int requiredPlayerRange, TrialSpawner.StateAccessor stateAccessor, PlayerDetector playerDetector, PlayerDetector.EntitySelector entitySelector)
-
-
Method Details
-
codec
-
getConfig
-
getNormalConfig
-
getOminousConfig
-
getOminousConfigForSerialization
-
applyOminous
-
removeOminous
-
isOminous
public boolean isOminous() -
getData
-
getTargetCooldownLength
public int getTargetCooldownLength() -
getRequiredPlayerRange
public int getRequiredPlayerRange() -
getState
-
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 type, ParticleOptions particle) -
addEjectItemParticles
-
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
-