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 p_312676_, PlayerDetector p_312004_, PlayerDetector.EntitySelector p_323917_) TrialSpawner(TrialSpawnerConfig p_323942_, TrialSpawnerConfig p_338891_, TrialSpawnerData p_323470_, int p_338747_, int p_338885_, TrialSpawner.StateAccessor p_312198_, PlayerDetector p_312690_, PlayerDetector.EntitySelector p_323834_) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddBecomeOminousParticles(Level p_338657_, BlockPos p_338406_, RandomSource p_338527_) static voidaddDetectPlayerParticles(Level p_312225_, BlockPos p_311759_, RandomSource p_312553_, int p_312188_, ParticleOptions p_338522_) static voidaddEjectItemParticles(Level p_312009_, BlockPos p_312583_, RandomSource p_312715_) static voidaddSpawnParticles(Level p_312303_, BlockPos p_312392_, RandomSource p_312825_, SimpleParticleType p_338426_) voidapplyOminous(ServerLevel p_338315_, BlockPos p_338416_) booleancanSpawnInLevel(Level p_312615_) com.mojang.serialization.Codec<TrialSpawner> codec()voidejectReward(ServerLevel p_312892_, BlockPos p_312668_, ResourceKey<LootTable> p_335942_) 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 p_312623_, Vec3 p_312390_, Vec3 p_312652_) booleanvoidvoidDeprecated, for removal: This API element is subject to removal in a future version.voidremoveOminous(ServerLevel p_338672_, BlockPos p_338318_) voidsetPlayerDetector(PlayerDetector p_312510_) Deprecated, for removal: This API element is subject to removal in a future version.voidsetState(Level p_312688_, TrialSpawnerState p_312718_) private static booleanshouldMobBeUntracked(ServerLevel p_312908_, BlockPos p_312807_, UUID p_311952_) spawnMob(ServerLevel p_312582_, BlockPos p_312518_) voidtickClient(Level p_312771_, BlockPos p_312484_, boolean p_338382_) voidtickServer(ServerLevel p_312132_, BlockPos p_312062_, boolean p_338207_)
-
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 p_312676_, PlayerDetector p_312004_, PlayerDetector.EntitySelector p_323917_) -
TrialSpawner
public TrialSpawner(TrialSpawnerConfig p_323942_, TrialSpawnerConfig p_338891_, TrialSpawnerData p_323470_, int p_338747_, int p_338885_, TrialSpawner.StateAccessor p_312198_, PlayerDetector p_312690_, PlayerDetector.EntitySelector p_323834_)
-
-
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
public void ejectReward(ServerLevel p_312892_, BlockPos p_312668_, ResourceKey<LootTable> p_335942_) -
tickClient
-
tickServer
-
shouldMobBeUntracked
private static boolean shouldMobBeUntracked(ServerLevel p_312908_, BlockPos p_312807_, UUID p_311952_) -
inLineOfSight
-
addSpawnParticles
public static void addSpawnParticles(Level p_312303_, BlockPos p_312392_, RandomSource p_312825_, SimpleParticleType p_338426_) -
addBecomeOminousParticles
public static void addBecomeOminousParticles(Level p_338657_, BlockPos p_338406_, RandomSource p_338527_) -
addDetectPlayerParticles
public static void addDetectPlayerParticles(Level p_312225_, BlockPos p_311759_, RandomSource p_312553_, int p_312188_, ParticleOptions p_338522_) -
addEjectItemParticles
public static void addEjectItemParticles(Level p_312009_, BlockPos p_312583_, RandomSource p_312715_) -
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
-