Class TrialSpawner
java.lang.Object
net.minecraft.world.level.block.entity.trialspawner.TrialSpawner
- All Implemented Interfaces:
IOwnedSpawner
-
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_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 void
addBecomeOminousParticles
(Level p_338657_, BlockPos p_338406_, RandomSource p_338527_) static void
addDetectPlayerParticles
(Level p_312225_, BlockPos p_311759_, RandomSource p_312553_, int p_312188_, ParticleOptions p_338522_) static void
addEjectItemParticles
(Level p_312009_, BlockPos p_312583_, RandomSource p_312715_) static void
addSpawnParticles
(Level p_312303_, BlockPos p_312392_, RandomSource p_312825_, SimpleParticleType p_338426_) void
applyOminous
(ServerLevel p_338315_, BlockPos p_338416_) boolean
canSpawnInLevel
(Level p_312615_) com.mojang.serialization.Codec
<TrialSpawner> codec()
void
ejectReward
(ServerLevel p_312892_, BlockPos p_312668_, ResourceKey<LootTable> p_335942_) getData()
private TrialSpawnerConfig
com.mojang.datafixers.util.Either
<BlockEntity, Entity> getOwner()
Returns the block entity or entity which owns this spawner object.int
getState()
int
private static boolean
inLineOfSight
(Level p_312623_, Vec3 p_312390_, Vec3 p_312652_) boolean
void
void
Deprecated, for removal: This API element is subject to removal in a future version.void
removeOminous
(ServerLevel p_338672_, BlockPos p_338318_) void
setPlayerDetector
(PlayerDetector p_312510_) Deprecated, for removal: This API element is subject to removal in a future version.void
setState
(Level p_312688_, TrialSpawnerState p_312718_) private static boolean
shouldMobBeUntracked
(ServerLevel p_312908_, BlockPos p_312807_, UUID p_311952_) spawnMob
(ServerLevel p_312582_, BlockPos p_312518_) void
tickClient
(Level p_312771_, BlockPos p_312484_, boolean p_338382_) void
tickServer
(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:IOwnedSpawner
Returns the block entity or entity which owns this spawner object.For a
BaseSpawner
, this is theinvalid reference
MobSpawnerBlockEntity
MinecartSpawner
.For a
TrialSpawner
, this is theTrialSpawnerBlockEntity
.- Specified by:
getOwner
in interfaceIOwnedSpawner
-