Class TrialSpawner
java.lang.Object
net.minecraft.world.level.block.entity.trialspawner.TrialSpawner
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
static interface
-
Field Summary
Modifier and TypeFieldDescriptionprivate final TrialSpawnerData
private static final int
private static final int
static final int
private final PlayerDetector.EntitySelector
private boolean
private static final int
private static final int
static final String
private final TrialSpawnerConfig
static final String
private final TrialSpawnerConfig
private boolean
private PlayerDetector
private final int
private static final float
private final TrialSpawner.StateAccessor
private final int
-
Constructor Summary
ConstructorDescriptionTrialSpawner
(TrialSpawner.StateAccessor p_310216_, PlayerDetector p_309626_, PlayerDetector.EntitySelector p_328170_) TrialSpawner
(TrialSpawnerConfig p_327983_, TrialSpawnerConfig p_327832_, TrialSpawnerData p_330822_, int p_330441_, int p_335693_, TrialSpawner.StateAccessor p_310539_, PlayerDetector p_312974_, PlayerDetector.EntitySelector p_333634_) -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addBecomeOminousParticles
(Level p_312837_, BlockPos p_311261_, RandomSource p_312356_) static void
addDetectPlayerParticles
(Level p_309415_, BlockPos p_309941_, RandomSource p_310263_, int p_310988_, ParticleOptions p_331085_) static void
addEjectItemParticles
(Level p_311170_, BlockPos p_309958_, RandomSource p_309409_) static void
addSpawnParticles
(Level p_333032_, BlockPos p_328008_, RandomSource p_330922_, SimpleParticleType p_331431_) void
applyOminous
(ServerLevel p_334207_, BlockPos p_327778_) boolean
canSpawnInLevel
(Level p_312209_) com.mojang.serialization.Codec
<TrialSpawner> codec()
void
ejectReward
(ServerLevel p_310080_, BlockPos p_311547_, ResourceKey<LootTable> p_330647_) getData()
private TrialSpawnerConfig
int
getState()
int
private static boolean
inLineOfSight
(Level p_311873_, Vec3 p_311845_, Vec3 p_312229_) boolean
void
void
Deprecated, for removal: This API element is subject to removal in a future version.void
removeOminous
(ServerLevel p_336080_, BlockPos p_328593_) void
setPlayerDetector
(PlayerDetector p_311472_) Deprecated, for removal: This API element is subject to removal in a future version.void
setState
(Level p_310153_, TrialSpawnerState p_312484_) private static boolean
shouldMobBeUntracked
(ServerLevel p_312275_, BlockPos p_310158_, UUID p_312011_) spawnMob
(ServerLevel p_312690_, BlockPos p_313108_) void
tickClient
(Level p_309627_, BlockPos p_311485_, boolean p_332221_) void
tickServer
(ServerLevel p_310996_, BlockPos p_312836_, boolean p_332881_)
-
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_310216_, PlayerDetector p_309626_, PlayerDetector.EntitySelector p_328170_) -
TrialSpawner
public TrialSpawner(TrialSpawnerConfig p_327983_, TrialSpawnerConfig p_327832_, TrialSpawnerData p_330822_, int p_330441_, int p_335693_, TrialSpawner.StateAccessor p_310539_, PlayerDetector p_312974_, PlayerDetector.EntitySelector p_333634_)
-
-
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_310080_, BlockPos p_311547_, ResourceKey<LootTable> p_330647_) -
tickClient
-
tickServer
-
shouldMobBeUntracked
private static boolean shouldMobBeUntracked(ServerLevel p_312275_, BlockPos p_310158_, UUID p_312011_) -
inLineOfSight
-
addSpawnParticles
public static void addSpawnParticles(Level p_333032_, BlockPos p_328008_, RandomSource p_330922_, SimpleParticleType p_331431_) -
addBecomeOminousParticles
public static void addBecomeOminousParticles(Level p_312837_, BlockPos p_311261_, RandomSource p_312356_) -
addDetectPlayerParticles
public static void addDetectPlayerParticles(Level p_309415_, BlockPos p_309941_, RandomSource p_310263_, int p_310988_, ParticleOptions p_331085_) -
addEjectItemParticles
public static void addEjectItemParticles(Level p_311170_, BlockPos p_309958_, RandomSource p_309409_) -
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.
-