Package net.minecraft.world.level
Interface LevelAccessor
- All Superinterfaces:
BiomeManager.NoiseBiomeSource
,BlockAndTintGetter
,BlockGetter
,CollisionGetter
,CommonLevelAccessor
,EntityGetter
,IBlockAndTintGetterExtension
,IBlockGetterExtension
,ILevelReaderExtension
,LevelHeightAccessor
,LevelReader
,LevelSimulatedReader
,LevelSimulatedRW
,LevelTimeAccess
,LevelWriter
,SignalGetter
- All Known Subinterfaces:
ServerLevelAccessor
,WorldGenLevel
- All Known Implementing Classes:
ClientLevel
,Level
,ServerLevel
,WorldGenRegion
-
Field Summary
Fields inherited from interface net.minecraft.world.level.SignalGetter
DIRECTIONS
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addParticle
(ParticleOptions particleData, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed) default void
blockUpdated
(BlockPos pos, Block block) private <T> ScheduledTick
<T> createTick
(BlockPos pos, T type, int delay) private <T> ScheduledTick
<T> createTick
(BlockPos pos, T type, int delay, TickPriority priority) default long
dayTime()
default void
gameEvent
(Holder<GameEvent> gameEvent, BlockPos pos, GameEvent.Context context) void
gameEvent
(Holder<GameEvent> gameEvent, Vec3 pos, GameEvent.Context context) default void
gameEvent
(ResourceKey<GameEvent> gameEvent, BlockPos pos, GameEvent.Context context) default void
default void
default Difficulty
default boolean
hasChunk
(int chunkX, int chunkZ) default void
levelEvent
(int type, BlockPos pos, int data) void
levelEvent
(Player player, int type, BlockPos pos, int data) default void
neighborShapeChanged
(Direction direction, BlockState queried, BlockPos pos, BlockPos offsetPos, int flags, int recursionLevel) long
default void
playSound
(Player player, BlockPos pos, SoundEvent sound, SoundSource source) void
playSound
(Player player, BlockPos pos, SoundEvent sound, SoundSource source, float volume, float pitch) Plays a sound.default void
scheduleTick
(BlockPos pos, Block block, int delay) default void
scheduleTick
(BlockPos pos, Block block, int delay, TickPriority priority) default void
scheduleTick
(BlockPos pos, Fluid fluid, int delay) default void
scheduleTick
(BlockPos pos, Fluid fluid, int delay, TickPriority priority) Methods inherited from interface net.minecraft.world.level.BlockAndTintGetter
canSeeSky, getBrightness, getLightEngine, getRawBrightness, getShade
Methods inherited from interface net.minecraft.world.level.BlockGetter
clip, clipWithInteractionOverride, getBlockEntity, getBlockFloorHeight, getBlockFloorHeight, getBlockState, getBlockStates, getFluidState, getLightEmission, getMaxLightLevel, isBlockInLine
Methods inherited from interface net.minecraft.world.level.CollisionGetter
collidesWithSuffocatingBlock, findFreePosition, findSupportingBlock, getBlockCollisions, getCollisions, getEntityCollisions, getWorldBorder, isUnobstructed, isUnobstructed, isUnobstructed, noBlockCollision, noCollision, noCollision, noCollision
Methods inherited from interface net.minecraft.world.level.CommonLevelAccessor
getBlockEntity, getEntityCollisions, getHeightmapPos, isUnobstructed
Methods inherited from interface net.minecraft.world.level.EntityGetter
getEntities, getEntities, getEntities, getEntitiesOfClass, getEntitiesOfClass, getNearbyEntities, getNearbyPlayers, getNearestEntity, getNearestEntity, getNearestPlayer, getNearestPlayer, getNearestPlayer, getNearestPlayer, getNearestPlayer, getNearestPlayer, getPlayerByUUID, hasNearbyAlivePlayer, players
Methods inherited from interface net.neoforged.neoforge.common.extensions.IBlockAndTintGetterExtension
getShade
Methods inherited from interface net.neoforged.neoforge.common.extensions.IBlockGetterExtension
getAuxLightManager, getAuxLightManager, getModelData
Methods inherited from interface net.neoforged.neoforge.common.extensions.ILevelReaderExtension
holder, holderOrThrow, isAreaLoaded
Methods inherited from interface net.minecraft.world.level.LevelHeightAccessor
getMaxBuildHeight, getMaxSection, getMinSection, getSectionIndex, getSectionIndexFromSectionY, getSectionsCount, getSectionYFromSectionIndex, isOutsideBuildHeight, isOutsideBuildHeight
Methods inherited from interface net.minecraft.world.level.LevelReader
canSeeSkyFromBelowWater, containsAnyLiquid, dimensionType, enabledFeatures, getBiome, getBiomeManager, getBlockStatesIfLoaded, getBlockTint, getChunk, getChunk, getChunk, getChunk, getChunkForCollisions, getHeight, getHeight, getLightLevelDependentMagicValue, getMaxLocalRawBrightness, getMaxLocalRawBrightness, getMinBuildHeight, getNoiseBiome, getPathfindingCostFromLightLevels, getSeaLevel, getSkyDarken, getUncachedNoiseBiome, hasChunkAt, hasChunkAt, hasChunksAt, hasChunksAt, hasChunksAt, holderLookup, isClientSide, isEmptyBlock, isWaterAt, registryAccess
Methods inherited from interface net.minecraft.world.level.LevelSimulatedReader
isFluidAtPosition, isStateAtPosition
Methods inherited from interface net.minecraft.world.level.LevelTimeAccess
getMoonBrightness, getMoonPhase, getTimeOfDay
Methods inherited from interface net.minecraft.world.level.LevelWriter
addFreshEntity, destroyBlock, destroyBlock, destroyBlock, removeBlock, setBlock, setBlock
Methods inherited from interface net.minecraft.world.level.SignalGetter
getBestNeighborSignal, getControlInputSignal, getDirectSignal, getDirectSignalTo, getSignal, hasNeighborSignal, hasSignal
-
Method Details
-
dayTime
default long dayTime()- Specified by:
dayTime
in interfaceLevelTimeAccess
-
nextSubTickCount
long nextSubTickCount() -
getBlockTicks
LevelTickAccess<Block> getBlockTicks() -
createTick
-
createTick
-
scheduleTick
-
scheduleTick
-
getFluidTicks
LevelTickAccess<Fluid> getFluidTicks() -
scheduleTick
-
scheduleTick
-
getLevelData
LevelData getLevelData() -
getCurrentDifficultyAt
-
getServer
-
getDifficulty
-
getChunkSource
ChunkSource getChunkSource() -
hasChunk
default boolean hasChunk(int chunkX, int chunkZ) - Specified by:
hasChunk
in interfaceLevelReader
-
getRandom
RandomSource getRandom() -
blockUpdated
-
neighborShapeChanged
default void neighborShapeChanged(Direction direction, BlockState queried, BlockPos pos, BlockPos offsetPos, int flags, int recursionLevel) - Parameters:
queried
- The block state of the current blockpos
- The position of the neighbor blockoffsetPos
- The position of the current block
-
playSound
-
playSound
void playSound(@Nullable Player player, BlockPos pos, SoundEvent sound, SoundSource source, float volume, float pitch) Plays a sound. On the server, the sound is broadcast to all nearby except the given player. On the client, the sound only plays if the given player is the client player. Thus, this method is intended to be called from code running on both sides. The client plays it locally and the server plays it for everyone else. -
addParticle
void addParticle(ParticleOptions particleData, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed) -
levelEvent
-
levelEvent
-
gameEvent
-
gameEvent
-
gameEvent
-
gameEvent
-
gameEvent
-