Package net.minecraft.world.entity.npc
Class WanderingTraderSpawner
java.lang.Object
net.minecraft.world.entity.npc.WanderingTraderSpawner
- All Implemented Interfaces:
CustomSpawner
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
private static final int
private static final int
private static final int
private static final int
private final RandomSource
private final ServerLevelData
private static final int
private static final int
private int
private int
private int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate BlockPos
findSpawnPositionNear
(LevelReader pLevel, BlockPos pPos, int pMaxDistance) private boolean
hasEnoughSpace
(BlockGetter pLevel, BlockPos pPos) private boolean
spawn
(ServerLevel pServerLevel) int
tick
(ServerLevel pLevel, boolean pSpawnHostiles, boolean pSpawnPassives) private void
tryToSpawnLlamaFor
(ServerLevel pServerLevel, WanderingTrader pTrader, int pMaxDistance)
-
Field Details
-
DEFAULT_TICK_DELAY
private static final int DEFAULT_TICK_DELAY- See Also:
-
DEFAULT_SPAWN_DELAY
public static final int DEFAULT_SPAWN_DELAY- See Also:
-
MIN_SPAWN_CHANCE
private static final int MIN_SPAWN_CHANCE- See Also:
-
MAX_SPAWN_CHANCE
private static final int MAX_SPAWN_CHANCE- See Also:
-
SPAWN_CHANCE_INCREASE
private static final int SPAWN_CHANCE_INCREASE- See Also:
-
SPAWN_ONE_IN_X_CHANCE
private static final int SPAWN_ONE_IN_X_CHANCE- See Also:
-
NUMBER_OF_SPAWN_ATTEMPTS
private static final int NUMBER_OF_SPAWN_ATTEMPTS- See Also:
-
random
-
serverLevelData
-
tickDelay
private int tickDelay -
spawnDelay
private int spawnDelay -
spawnChance
private int spawnChance
-
-
Constructor Details
-
WanderingTraderSpawner
-
-
Method Details
-
tick
- Specified by:
tick
in interfaceCustomSpawner
-
spawn
-
tryToSpawnLlamaFor
private void tryToSpawnLlamaFor(ServerLevel pServerLevel, WanderingTrader pTrader, int pMaxDistance) -
findSpawnPositionNear
@Nullable private BlockPos findSpawnPositionNear(LevelReader pLevel, BlockPos pPos, int pMaxDistance) -
hasEnoughSpace
-