net.minecraft.block

public class Block

extends AbstractBlock implements ItemConvertible

All mapped superinterfaces:

ToggleableFeature, ItemConvertible

net.minecraft.world.level.block.Block
net.minecraft.world.level.block.Block
net.minecraft.class_2248
net.minecraft.block.Block

Field summary

Modifier and TypeField
public static final com.mojang.serialization.MapCodec<Block>
CODEC
CODEC
field_46280
CODEC
private static final org.slf4j.Logger
LOGGER
LOGGER
field_10638
LOGGER
private final RegistryEntry$Reference<Block>
builtInRegistryHolder
builtInRegistryHolder
field_36404
registryEntry
public static final IdList<BlockState>
BLOCK_STATE_REGISTRY
BLOCK_STATE_REGISTRY
field_10651
STATE_IDS
private static final com.google.common.cache.LoadingCache<VoxelShape, Boolean>
SHAPE_FULL_BLOCK_CACHE
SHAPE_FULL_BLOCK_CACHE
field_19312
FULL_CUBE_SHAPE_CACHE
public static final int
UPDATE_NEIGHBORS
UPDATE_NEIGHBORS
field_31027
NOTIFY_NEIGHBORS
public static final int
UPDATE_CLIENTS
UPDATE_CLIENTS
field_31028
NOTIFY_LISTENERS
public static final int
UPDATE_INVISIBLE
UPDATE_INVISIBLE
field_31029
NO_REDRAW
public static final int
UPDATE_IMMEDIATE
UPDATE_IMMEDIATE
field_31030
REDRAW_ON_MAIN_THREAD
public static final int
UPDATE_KNOWN_SHAPE
UPDATE_KNOWN_SHAPE
field_31031
FORCE_STATE
public static final int
UPDATE_SUPPRESS_DROPS
UPDATE_SUPPRESS_DROPS
field_31032
SKIP_DROPS
public static final int
UPDATE_MOVE_BY_PISTON
UPDATE_MOVE_BY_PISTON
field_31033
MOVED
public static final int
UPDATE_SKIP_SHAPE_UPDATE_ON_WIRE
UPDATE_SKIP_SHAPE_UPDATE_ON_WIRE
field_53822
SKIP_REDSTONE_WIRE_STATE_REPLACEMENT
public static final int
UPDATE_SKIP_BLOCK_ENTITY_SIDEEFFECTS
UPDATE_SKIP_BLOCK_ENTITY_SIDEEFFECTS
field_55739
SKIP_BLOCK_ENTITY_REPLACED_CALLBACK
public static final int
UPDATE_SKIP_ON_PLACE
UPDATE_SKIP_ON_PLACE
field_56561
SKIP_BLOCK_ADDED_CALLBACK
public static final int
UPDATE_NONE
UPDATE_NONE
field_31035
SKIP_REDRAW_AND_BLOCK_ENTITY_REPLACED_CALLBACK
public static final int
UPDATE_ALL
UPDATE_ALL
field_31036
NOTIFY_ALL
public static final int
UPDATE_ALL_IMMEDIATE
UPDATE_ALL_IMMEDIATE
field_31022
NOTIFY_ALL_AND_REDRAW
public static final int
UPDATE_SKIP_ALL_SIDEEFFECTS
UPDATE_SKIP_ALL_SIDEEFFECTS
field_55740
FORCE_STATE_AND_SKIP_CALLBACKS_AND_DROPS
public static final float
INDESTRUCTIBLE
INDESTRUCTIBLE
field_31023
field_31023
public static final float
INSTANT
INSTANT
field_31024
field_31024
public static final int
UPDATE_LIMIT
UPDATE_LIMIT
field_31025
field_31025
protected final StateManager<Block, BlockState>
stateDefinition
stateDefinition
field_10647
stateManager
private BlockState
defaultBlockState
defaultBlockState
field_10646
defaultState
private Item
item
item
field_17562
cachedItem
private static final int
CACHE_SIZE
CACHE_SIZE
field_31026
FACE_CULL_MAP_SIZE
private static final ThreadLocal<it.unimi.dsi.fastutil.objects.Object2ByteLinkedOpenHashMap<Block$VoxelShapePair>>
OCCLUSION_CACHE
OCCLUSION_CACHE
field_10649
FACE_CULL_MAP

Constructor summary

ModifierConstructor
public (AbstractBlock$Settings properties)

Method summary

Modifier and TypeMethod
protected com.mojang.serialization.MapCodec<? extends Block>
codec()
codec()
method_53969()
getCodec()
public static int
getId(BlockState blockState)
getId(BlockState blockState)
method_9507(class_2680 arg0)
getRawIdFromState(BlockState state)
public static BlockState
stateById(int idWithData)
stateById(int idWithData)
method_9531(int arg0)
getStateFromRawId(int stateId)
public static Block
byItem(Item item)
byItem(Item item)
method_9503(class_1792 arg0)
getBlockFromItem(Item item)
public static BlockState
pushEntitiesUp(BlockState state, BlockState newState, LevelAccessor level, BlockPos pos)
pushEntitiesUp(BlockState state, BlockState newState, LevelAccessor level, BlockPos pos)
method_9582(class_2680 arg0, class_2680 arg1, class_1936 arg2, class_2338 arg3)
pushEntitiesUpBeforeBlockChange(BlockState from, BlockState to, WorldAccess world, BlockPos pos)
public static VoxelShape
box(double minX, double minY, double minZ, double maxX, double maxY, double maxZ)
box(double minX, double minY, double minZ, double maxX, double maxY, double maxZ)
method_9541(double arg0, double arg1, double arg2, double arg3, double arg4, double arg5)
createCuboidShape(double minX, double minY, double minZ, double maxX, double maxY, double maxZ)
public static VoxelShape[]
boxes(int endInclusive, IntFunction<VoxelShape> voxelShapeFactory)
boxes(int endInclusive, IntFunction<VoxelShape> voxelShapeFactory)
method_66397(int arg0, IntFunction<class_265> arg1)
createShapeArray(int size, IntFunction<VoxelShape> indexToShape)
public static VoxelShape
cube(double size)
cube(double size)
method_66393(double arg0)
createCubeShape(double size)
public static VoxelShape
cube(double sizeX, double sizeY, double sizeZ)
cube(double sizeX, double sizeY, double sizeZ)
method_66394(double arg0, double arg1, double arg2)
createCuboidShape(double sizeX, double sizeY, double sizeZ)
public static VoxelShape
column(double sizeXZ, double minY, double maxY)
column(double sizeXZ, double minY, double maxY)
method_66404(double arg0, double arg1, double arg2)
createColumnShape(double sizeXz, double minY, double maxY)
public static VoxelShape
column(double sizeX, double sizeZ, double minY, double maxY)
column(double sizeX, double sizeZ, double minY, double maxY)
method_66395(double arg0, double arg1, double arg2, double arg3)
createColumnShape(double sizeX, double sizeZ, double minY, double maxY)
public static VoxelShape
boxZ(double sizeXY, double minZ, double maxZ)
boxZ(double sizeXY, double minZ, double maxZ)
method_66408(double arg0, double arg1, double arg2)
createCuboidZShape(double sizeXy, double minZ, double maxZ)
public static VoxelShape
boxZ(double sizeX, double sizeY, double minZ, double maxZ)
boxZ(double sizeX, double sizeY, double minZ, double maxZ)
method_66405(double arg0, double arg1, double arg2, double arg3)
createCuboidZShape(double sizeX, double sizeY, double minZ, double maxZ)
public static VoxelShape
boxZ(double sizeX, double minY, double maxY, double minZ, double maxZ)
boxZ(double sizeX, double minY, double maxY, double minZ, double maxZ)
method_66396(double arg0, double arg1, double arg2, double arg3, double arg4)
createCuboidZShape(double sizeX, double minY, double maxY, double minZ, double maxZ)
public static BlockState
updateFromNeighbourShapes(BlockState state, LevelAccessor level, BlockPos pos)
updateFromNeighbourShapes(BlockState state, LevelAccessor level, BlockPos pos)
method_9510(class_2680 arg0, class_1936 arg1, class_2338 arg2)
postProcessState(BlockState state, WorldAccess world, BlockPos pos)
public static void
updateOrDestroy(BlockState blockState, BlockState newState, LevelAccessor level, BlockPos blockPos, int updateFlags)
updateOrDestroy(BlockState blockState, BlockState newState, LevelAccessor level, BlockPos blockPos, int updateFlags)
method_30094(class_2680 arg0, class_2680 arg1, class_1936 arg2, class_2338 arg3, int arg4)
replace(BlockState state, BlockState newState, WorldAccess world, BlockPos pos, int flags)
public static void
updateOrDestroy(BlockState blockState, BlockState newState, LevelAccessor level, BlockPos blockPos, int updateFlags, int updateLimit)
updateOrDestroy(BlockState blockState, BlockState newState, LevelAccessor level, BlockPos blockPos, int updateFlags, int updateLimit)
method_9611(class_2680 arg0, class_2680 arg1, class_1936 arg2, class_2338 arg3, int arg4, int arg5)
replace(BlockState state, BlockState newState, WorldAccess world, BlockPos pos, int flags, int maxUpdateDepth)
public static boolean
isExceptionForConnection(BlockState state)
isExceptionForConnection(BlockState state)
method_9581(class_2680 arg0)
cannotConnect(BlockState state)
protected static boolean
dropFromBlockInteractLootTable(ServerLevel level, ResourceKey<LootTable> key, BlockState interactedBlockState, BlockEntity interactedBlockEntity, ItemInstance tool, Entity interactingEntity, BiConsumer<ServerLevel, ItemStack> consumer)
dropFromBlockInteractLootTable(ServerLevel level, ResourceKey<LootTable> key, BlockState interactedBlockState, BlockEntity interactedBlockEntity, ItemInstance tool, Entity interactingEntity, BiConsumer<ServerLevel, ItemStack> consumer)
method_72546(class_3218 arg0, class_5321<class_52> arg1, class_2680 arg2, class_2586 arg3, class_1_96 arg4, class_1297 arg5, BiConsumer<class_3218, class_1799> arg6)
generateBlockInteractLoot(ServerWorld world, RegistryKey<LootTable> lootTable, BlockState state, BlockEntity blockEntity, ItemStackView arg4, Entity interactingEntity, BiConsumer<ServerWorld, ItemStack> lootConsumer)
protected static boolean
dropFromLootTable(ServerLevel level, ResourceKey<LootTable> key, Function<LootParams$Builder, LootParams> paramsBuilder, BiConsumer<ServerLevel, ItemStack> consumer)
dropFromLootTable(ServerLevel level, ResourceKey<LootTable> key, Function<LootParams$Builder, LootParams> paramsBuilder, BiConsumer<ServerLevel, ItemStack> consumer)
method_72547(class_3218 arg0, class_5321<class_52> arg1, Function<class_8567$class_8568, class_8567> arg2, BiConsumer<class_3218, class_1799> arg3)
generateLoot(ServerWorld world, RegistryKey<LootTable> lootTable, Function<LootWorldContext$Builder, LootWorldContext> contextFactory, BiConsumer<ServerWorld, ItemStack> lootConsumer)
public static boolean
shouldRenderFace(BlockState state, BlockState neighborState, Direction direction)
shouldRenderFace(BlockState state, BlockState neighborState, Direction direction)
method_9607(class_2680 arg0, class_2680 arg1, class_2350 arg2)
shouldDrawSide(BlockState state, BlockState otherState, Direction side)
public static boolean
canSupportRigidBlock(BlockGetter level, BlockPos below)
canSupportRigidBlock(BlockGetter level, BlockPos below)
method_16361(class_1922 arg0, class_2338 arg1)
hasTopRim(BlockView world, BlockPos pos)
public static boolean
canSupportCenter(LevelReader level, BlockPos belowPos, Direction direction)
canSupportCenter(LevelReader level, BlockPos belowPos, Direction direction)
method_20044(class_4538 arg0, class_2338 arg1, class_2350 arg2)
sideCoversSmallSquare(WorldView world, BlockPos pos, Direction side)
public static boolean
isFaceFull(VoxelShape shape, Direction direction)
isFaceFull(VoxelShape shape, Direction direction)
method_9501(class_265 arg0, class_2350 arg1)
isFaceFullSquare(VoxelShape shape, Direction side)
public static boolean
isShapeFullBlock(VoxelShape shape)
isShapeFullBlock(VoxelShape shape)
method_9614(class_265 arg0)
isShapeFullCube(VoxelShape shape)
public void
animateTick(BlockState state, Level level, BlockPos pos, RandomSource random)
animateTick(BlockState state, Level level, BlockPos pos, RandomSource random)
method_9496(class_2680 arg0, class_1937 arg1, class_2338 arg2, class_5819 arg3)
randomDisplayTick(BlockState state, World world, BlockPos pos, Random random)
public void
destroy(LevelAccessor level, BlockPos pos, BlockState state)
destroy(LevelAccessor level, BlockPos pos, BlockState state)
method_9585(class_1936 arg0, class_2338 arg1, class_2680 arg2)
onBroken(WorldAccess world, BlockPos pos, BlockState state)
public static List<ItemStack>
getDrops(BlockState state, ServerLevel level, BlockPos pos, BlockEntity blockEntity)
getDrops(BlockState state, ServerLevel level, BlockPos pos, BlockEntity blockEntity)
method_9562(class_2680 arg0, class_3218 arg1, class_2338 arg2, class_2586 arg3)
getDroppedStacks(BlockState state, ServerWorld world, BlockPos pos, BlockEntity blockEntity)
public static List<ItemStack>
getDrops(BlockState state, ServerLevel level, BlockPos pos, BlockEntity blockEntity, Entity breaker, ItemInstance tool)
getDrops(BlockState state, ServerLevel level, BlockPos pos, BlockEntity blockEntity, Entity breaker, ItemInstance tool)
method_9609(class_2680 arg0, class_3218 arg1, class_2338 arg2, class_2586 arg3, class_1297 arg4, class_1_96 arg5)
getDroppedStacks(BlockState state, ServerWorld world, BlockPos pos, BlockEntity blockEntity, Entity entity, ItemStackView arg5)
public static void
dropResources(BlockState state, Level level, BlockPos pos)
dropResources(BlockState state, Level level, BlockPos pos)
method_9497(class_2680 arg0, class_1937 arg1, class_2338 arg2)
dropStacks(BlockState state, World world, BlockPos pos)
public static void
dropResources(BlockState state, LevelAccessor level, BlockPos pos, BlockEntity blockEntity)
dropResources(BlockState state, LevelAccessor level, BlockPos pos, BlockEntity blockEntity)
method_9610(class_2680 arg0, class_1936 arg1, class_2338 arg2, class_2586 arg3)
dropStacks(BlockState state, WorldAccess world, BlockPos pos, BlockEntity blockEntity)
public static void
dropResources(BlockState state, Level level, BlockPos pos, BlockEntity blockEntity, Entity breaker, ItemStack tool)
dropResources(BlockState state, Level level, BlockPos pos, BlockEntity blockEntity, Entity breaker, ItemStack tool)
method_9511(class_2680 arg0, class_1937 arg1, class_2338 arg2, class_2586 arg3, class_1297 arg4, class_1799 arg5)
dropStacks(BlockState state, World world, BlockPos pos, BlockEntity blockEntity, Entity entity, ItemStack tool)
public static void
popResource(Level level, BlockPos pos, ItemStack itemStack)
popResource(Level level, BlockPos pos, ItemStack itemStack)
method_9577(class_1937 arg0, class_2338 arg1, class_1799 arg2)
dropStack(World world, BlockPos pos, ItemStack stack)
public static void
popResourceFromFace(Level level, BlockPos pos, Direction face, ItemStack itemStack)
popResourceFromFace(Level level, BlockPos pos, Direction face, ItemStack itemStack)
method_36992(class_1937 arg0, class_2338 arg1, class_2350 arg2, class_1799 arg3)
dropStack(World world, BlockPos pos, Direction direction, ItemStack stack)
private static void
popResource(Level level, Supplier<ItemEntity> entityFactory, ItemStack itemStack)
popResource(Level level, Supplier<ItemEntity> entityFactory, ItemStack itemStack)
method_36993(class_1937 arg0, Supplier<class_1542> arg1, class_1799 arg2)
dropStack(World world, Supplier<ItemEntity> itemEntitySupplier, ItemStack stack)
protected void
popExperience(ServerLevel level, BlockPos pos, int amount)
popExperience(ServerLevel level, BlockPos pos, int amount)
method_9583(class_3218 arg0, class_2338 arg1, int arg2)
dropExperience(ServerWorld world, BlockPos pos, int size)
public float
getExplosionResistance()
getExplosionResistance()
method_9520()
getBlastResistance()
public void
wasExploded(ServerLevel level, BlockPos pos, Explosion explosion)
wasExploded(ServerLevel level, BlockPos pos, Explosion explosion)
method_9586(class_3218 arg0, class_2338 arg1, class_1927 arg2)
onDestroyedByExplosion(ServerWorld world, BlockPos pos, Explosion explosion)
public void
stepOn(Level level, BlockPos pos, BlockState onState, Entity entity)
stepOn(Level level, BlockPos pos, BlockState onState, Entity entity)
method_9591(class_1937 arg0, class_2338 arg1, class_2680 arg2, class_1297 arg3)
onSteppedOn(World world, BlockPos pos, BlockState state, Entity entity)
public BlockState
getStateForPlacement(BlockPlaceContext context)
getStateForPlacement(BlockPlaceContext context)
method_9605(class_1750 arg0)
getPlacementState(ItemPlacementContext ctx)
public void
playerDestroy(Level level, Player player, BlockPos pos, BlockState state, BlockEntity blockEntity, ItemStack destroyedWith)
playerDestroy(Level level, Player player, BlockPos pos, BlockState state, BlockEntity blockEntity, ItemStack destroyedWith)
method_9556(class_1937 arg0, class_1657 arg1, class_2338 arg2, class_2680 arg3, class_2586 arg4, class_1799 arg5)
afterBreak(World world, PlayerEntity player, BlockPos pos, BlockState state, BlockEntity blockEntity, ItemStack tool)
public void
setPlacedBy(Level level, BlockPos pos, BlockState state, LivingEntity by, ItemStack itemStack)
setPlacedBy(Level level, BlockPos pos, BlockState state, LivingEntity by, ItemStack itemStack)
method_9567(class_1937 arg0, class_2338 arg1, class_2680 arg2, class_1309 arg3, class_1799 arg4)
onPlaced(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack itemStack)
public boolean
isPossibleToRespawnInThis(BlockState state)
isPossibleToRespawnInThis(BlockState state)
method_9538(class_2680 arg0)
canMobSpawnInside(BlockState state)
public MutableText
getName()
getName()
method_9518()
getName()
public void
fallOn(Level level, BlockState state, BlockPos pos, Entity entity, double fallDistance)
fallOn(Level level, BlockState state, BlockPos pos, Entity entity, double fallDistance)
method_9554(class_1937 arg0, class_2680 arg1, class_2338 arg2, class_1297 arg3, double arg4)
onLandedUpon(World world, BlockState state, BlockPos pos, Entity entity, double fallDistance)
public void
updateEntityMovementAfterFallOn(BlockGetter level, Entity entity)
updateEntityMovementAfterFallOn(BlockGetter level, Entity entity)
method_9502(class_1922 arg0, class_1297 arg1)
onEntityLand(BlockView world, Entity entity)
public float
getFriction()
getFriction()
method_9499()
getSlipperiness()
public float
getSpeedFactor()
getSpeedFactor()
method_23349()
getVelocityMultiplier()
public float
getJumpFactor()
getJumpFactor()
method_23350()
getJumpVelocityMultiplier()
protected void
spawnDestroyParticles(Level level, Player player, BlockPos pos, BlockState state)
spawnDestroyParticles(Level level, Player player, BlockPos pos, BlockState state)
method_33614(class_1937 arg0, class_1657 arg1, class_2338 arg2, class_2680 arg3)
spawnBreakParticles(World world, PlayerEntity player, BlockPos pos, BlockState state)
public BlockState
playerWillDestroy(Level level, BlockPos pos, BlockState state, Player player)
playerWillDestroy(Level level, BlockPos pos, BlockState state, Player player)
method_9576(class_1937 arg0, class_2338 arg1, class_2680 arg2, class_1657 arg3)
onBreak(World world, BlockPos pos, BlockState state, PlayerEntity player)
public void
handlePrecipitation(BlockState state, Level level, BlockPos pos, Biome$Precipitation precipitation)
handlePrecipitation(BlockState state, Level level, BlockPos pos, Biome$Precipitation precipitation)
method_9504(class_2680 arg0, class_1937 arg1, class_2338 arg2, class_1959$class_1963 arg3)
precipitationTick(BlockState state, World world, BlockPos pos, Biome$Precipitation precipitation)
public boolean
dropFromExplosion(Explosion explosion)
dropFromExplosion(Explosion explosion)
method_9533(class_1927 arg0)
shouldDropItemsOnExplosion(Explosion explosion)
protected void
createBlockStateDefinition(StateDefinition$Builder<Block, BlockState> builder)
createBlockStateDefinition(StateDefinition$Builder<Block, BlockState> builder)
method_9515(class_2689$class_2690<class_2248, class_2680> arg0)
appendProperties(StateManager$Builder<Block, BlockState> builder)
public StateManager<Block, BlockState>
getStateDefinition()
getStateDefinition()
method_9595()
getStateManager()
protected final void
registerDefaultState(BlockState state)
registerDefaultState(BlockState state)
method_9590(class_2680 arg0)
setDefaultState(BlockState state)
public final BlockState
defaultBlockState()
defaultBlockState()
method_9564()
getDefaultState()
public final BlockState
withPropertiesOf(BlockState source)
withPropertiesOf(BlockState source)
method_34725(class_2680 arg0)
getStateWithProperties(BlockState state)
private static <T extends Comparable<T>> BlockState
copyProperty(BlockState from, BlockState to, Property<T> property)
copyProperty(BlockState from, BlockState to, Property<T> property)
method_34724(class_2680 arg0, class_2680 arg1, class_2769<T> arg2)
copyProperty(BlockState source, BlockState target, Property<T> property)
public Item
asItem()
asItem()
method_8389()
asItem()
public boolean
hasDynamicShape()
hasDynamicShape()
method_9543()
hasDynamicBounds()
protected Block
asBlock()
asBlock()
method_26160()
asBlock()
protected Function<BlockState, VoxelShape>
getShapeForEachState(Function<BlockState, VoxelShape> shapeCalculator)
getShapeForEachState(Function<BlockState, VoxelShape> shapeCalculator)
method_33615(Function<class_2680, class_265> arg0)
createShapeFunction(Function<BlockState, VoxelShape> stateToShape)
protected Function<BlockState, VoxelShape>
getShapeForEachState(Function<BlockState, VoxelShape> shapeCalculator, Property<?>... ignoredProperties)
getShapeForEachState(Function<BlockState, VoxelShape> shapeCalculator, Property<?>... ignoredProperties)
method_66403(Function<class_2680, class_265> arg0, class_2769<?>... arg1)
createShapeFunction(Function<BlockState, VoxelShape> stateToShape, Property<?>... properties)
private static <S extends State<?, S>, T extends Comparable<T>> S
setValueHelper(S state, Property<T> property, Object value)
setValueHelper(S state, Property<T> property, Object value)
method_66399(S arg0, class_2769<T> arg1, Object arg2)
applyValueToState(S state, Property<T> property, Object value)
public RegistryEntry$Reference<Block>
builtInRegistryHolder()
builtInRegistryHolder()
method_40142()
getRegistryEntry()
protected void
tryDropExperience(ServerLevel level, BlockPos pos, ItemStack tool, IntProvider xpRange)
tryDropExperience(ServerLevel level, BlockPos pos, ItemStack tool, IntProvider xpRange)
method_41420(class_3218 arg0, class_2338 arg1, class_1799 arg2, class_6017 arg3)
dropExperienceWhenMined(ServerWorld world, BlockPos pos, ItemStack tool, IntProvider experience)