Class Block
- All Implemented Interfaces:
ItemConvertible
,ToggleableFeature
- Direct Known Subclasses:
AbstractCandleBlock
,AbstractCauldronBlock
,AbstractCoralBlock
,AbstractFireBlock
,AbstractPlantPartBlock
,AbstractPressurePlateBlock
,AbstractRailBlock
,AbstractTorchBlock
,AirBlock
,AmethystBlock
,BambooBlock
,BambooShootBlock
,BarrierBlock
,BlockWithEntity
,BubbleColumnBlock
,BulbBlock
,CactusBlock
,CakeBlock
,CarpetBlock
,CartographyTableBlock
,ChorusFlowerBlock
,CobwebBlock
,ComposterBlock
,ConnectingBlock
,CoralBlockBlock
,CraftingTableBlock
,CryingObsidianBlock
,DirtPathBlock
,DoorBlock
,EndPortalFrameBlock
,ExperienceDroppingBlock
,FacingBlock
,FallingBlock
,FarmlandBlock
,FlowerPotBlock
,FluidBlock
,FrogspawnBlock
,HangingMossBlock
,HangingRootsBlock
,HeavyCoreBlock
,HorizontalConnectingBlock
,HorizontalFacingBlock
,InfestedBlock
,JigsawBlock
,LadderBlock
,LanternBlock
,LeavesBlock
,LightBlock
,MagmaBlock
,MangroveRootsBlock
,MossBlock
,MudBlock
,MultifaceGrowthBlock
,MushroomBlock
,NetherPortalBlock
,NetherrackBlock
,NoteBlock
,NyliumBlock
,OxidizableBlock
,PaleMossCarpetBlock
,PillarBlock
,PlantBlock
,PointedDripstoneBlock
,PowderSnowBlock
,PumpkinBlock
,RedstoneBlock
,RedstoneLampBlock
,RedstoneOreBlock
,RedstoneWireBlock
,RespawnAnchorBlock
,RootedDirtBlock
,ScaffoldingBlock
,SlabBlock
,SnifferEggBlock
,SnowBlock
,SnowyBlock
,SoulSandBlock
,SpongeBlock
,SporeBlossomBlock
,StairsBlock
,StonecutterBlock
,StructureVoidBlock
,SugarCaneBlock
,TargetBlock
,TntBlock
,TranslucentBlock
,TripwireBlock
,TripwireHookBlock
,TurtleEggBlock
,VineBlock
,WallBlock
,WetSpongeBlock
AbstractBlock
,
this class, and its subclasses define all logic for those voxels.
See the documentation on AbstractBlock
for instructions on overriding
methods.
There is exactly one instance for every type of block. Every stone
block for example in a world shares the same block instance. Each block
instance is registered under Registries.BLOCK
.
See Blocks
for examples of block instances.
An item corresponding to a block is not automatically created. You
may create your own BlockItem
and register it
under Registries.ITEM
.
The translation key for the block name is determined by AbstractBlock.getTranslationKey()
.
In the world, the actual voxels are not stored as blocks, but as
block states. The possible states of the block
are defined by appendProperties(net.minecraft.state.StateManager.Builder<net.minecraft.block.Block, net.minecraft.block.BlockState>)
.
- See Also:
- Mappings:
Namespace Name named net/minecraft/block/Block
intermediary net/minecraft/class_2248
official dkl
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.block.AbstractBlock
AbstractBlock.AbstractBlockState, AbstractBlock.ContextPredicate, AbstractBlock.Offsetter, AbstractBlock.OffsetType, AbstractBlock.Settings, AbstractBlock.TypedContextPredicate<A>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec
<Block> private BlockState
private static final ThreadLocal
<Object2ByteLinkedOpenHashMap<Block.VoxelShapePair>> private static final int
static final float
static final float
static final int
static final int
static final int
Bypass virtual block state changes and forces the passed state to be stored as-is.private static final LoadingCache
<VoxelShape, Boolean> private static final Logger
static final int
Signals that the current block is being moved to a different location, usually because of a piston.static final int
Used in conjunction withNOTIFY_LISTENERS
to suppress the render pass on clients.static final int
The default setBlockState behavior.static final int
Notifies neighbors and listeners, and forces a redraw on clients.static final int
Notifies listeners and clients who need to react when the block changes.static final int
Sends a neighbor update event to surrounding blocks.static final int
Forces a synchronous redraw on clients.private final RegistryEntry.Reference
<Block> static final int
Prevents the previous block (container) from dropping items when destroyed.static final int
static final IdList
<BlockState> protected final StateManager
<Block, BlockState> Fields inherited from class net.minecraft.block.AbstractBlock
collidable, DIRECTIONS, dynamicBounds, jumpVelocityMultiplier, lootTableKey, randomTicks, requiredFeatures, resistance, settings, slipperiness, soundGroup, translationKey, velocityMultiplier
Fields inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeature
FEATURE_ENABLED_REGISTRY_KEYS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
afterBreak
(World world, PlayerEntity player, BlockPos pos, BlockState state, @Nullable BlockEntity blockEntity, ItemStack tool) Called server-side when the block is broken by the player using correct tool.protected void
appendProperties
(StateManager.Builder<Block, BlockState> builder) Appends block state properties to this block.void
appendTooltip
(ItemStack stack, Item.TooltipContext context, List<Text> tooltip, TooltipType options) Appends tooltips to a stack of this block's corresponding block item.protected Block
asBlock()
Returns the block asBlock
.asItem()
Returns the block's corresponding item.boolean
canMobSpawnInside
(BlockState state) static boolean
cannotConnect
(BlockState state) private static <T extends Comparable<T>>
BlockStatecopyProperty
(BlockState source, BlockState target, Property<T> property) static VoxelShape
createCuboidShape
(double minX, double minY, double minZ, double maxX, double maxY, double maxZ) protected void
dropExperience
(ServerWorld world, BlockPos pos, int size) Drops experience orbs.protected void
dropExperienceWhenMined
(ServerWorld world, BlockPos pos, ItemStack tool, IntProvider experience) Drops experience orbs.private static void
dropStack
(World world, Supplier<ItemEntity> itemEntitySupplier, ItemStack stack) static void
static void
static void
dropStacks
(BlockState state, WorldAccess world, BlockPos pos, @Nullable BlockEntity blockEntity) static void
dropStacks
(BlockState state, World world, BlockPos pos) static void
dropStacks
(BlockState state, World world, BlockPos pos, @Nullable BlockEntity blockEntity, @Nullable Entity entity, ItemStack tool) float
static Block
getBlockFromItem
(@Nullable Item item) protected com.mojang.serialization.MapCodec
<? extends Block> getCodec()
final BlockState
getDroppedStacks
(BlockState state, ServerWorld world, BlockPos pos, @Nullable BlockEntity blockEntity) getDroppedStacks
(BlockState state, ServerWorld world, BlockPos pos, @Nullable BlockEntity blockEntity, @Nullable Entity entity, ItemStack stack) float
getName()
getPickStack
(WorldView world, BlockPos pos, BlockState state) Returns the new item stack when using pick block functionality.static int
getRawIdFromState
(@Nullable BlockState state) Deprecated.protected ImmutableMap
<BlockState, VoxelShape> getShapesForStates
(Function<BlockState, VoxelShape> stateToShape) float
static BlockState
getStateFromRawId
(int stateId) final BlockState
getStateWithProperties
(BlockState state) Gets a block state with all properties that both this block and the source block state have.float
boolean
static boolean
static boolean
isFaceFullSquare
(VoxelShape shape, Direction side) static boolean
isShapeFullCube
(VoxelShape shape) onBreak
(World world, BlockPos pos, BlockState state, PlayerEntity player) Called when a player breaks a block before the block is removed from the world.void
onBroken
(WorldAccess world, BlockPos pos, BlockState state) Called after a player breaks a block and the block is removed from the world.void
onDestroyedByExplosion
(ServerWorld world, BlockPos pos, Explosion explosion) Called when this block is destroyed by an explosion.void
onEntityLand
(BlockView world, Entity entity) Called after the entity lands on the block.void
onLandedUpon
(World world, BlockState state, BlockPos pos, Entity entity, float fallDistance) Called when the entity lands on the block.void
onPlaced
(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) Called when the player placed the block.void
onSteppedOn
(World world, BlockPos pos, BlockState state, Entity entity) Called when an entity steps on this block.static BlockState
postProcessState
(BlockState state, WorldAccess world, BlockPos pos) void
precipitationTick
(BlockState state, World world, BlockPos pos, Biome.Precipitation precipitation) Called randomly server-side on blocks with unobstructed sky access when it is raining or snowing.static BlockState
pushEntitiesUpBeforeBlockChange
(BlockState from, BlockState to, WorldAccess world, BlockPos pos) Pushes entities standing on a block up before changing the block to taller ones.void
randomDisplayTick
(BlockState state, World world, BlockPos pos, Random random) Called randomly on the client.static void
replace
(BlockState state, BlockState newState, WorldAccess world, BlockPos pos, int flags) Replaces thestate
with thenewState
at thepos
.static void
replace
(BlockState state, BlockState newState, WorldAccess world, BlockPos pos, int flags, int maxUpdateDepth) Replaces thestate
with thenewState
at thepos
.protected final void
setDefaultState
(BlockState state) Sets the default state of the block.static boolean
shouldDrawSide
(BlockState state, BlockState otherState, Direction side) boolean
shouldDropItemsOnExplosion
(Explosion explosion) Returns whether an explosion can drop the block as an item.static boolean
sideCoversSmallSquare
(WorldView world, BlockPos pos, Direction side) protected void
spawnBreakParticles
(World world, PlayerEntity player, BlockPos pos, BlockState state) toString()
Methods inherited from class net.minecraft.block.AbstractBlock
calcBlockBreakingDelta, canBucketPlace, canPathfindThrough, canPlaceAt, canReplace, createCodec, createScreenHandlerFactory, createSettingsCodec, emitsRedstonePower, getAmbientOcclusionLightLevel, getCameraCollisionShape, getCollisionShape, getComparatorOutput, getCullingShape, getDefaultMapColor, getDroppedStacks, getFluidState, getHardness, getInsideCollisionShape, getLootTableKey, getMaxHorizontalModelOffset, getOpacity, getOutlineShape, getRaycastShape, getRenderingSeed, getRenderType, getRequiredFeatures, getSettings, getSidesShape, getSoundGroup, getStateForNeighborUpdate, getStrongRedstonePower, getTranslationKey, getVerticalModelOffsetMultiplier, getWeakRedstonePower, hasComparatorOutput, hasRandomTicks, hasSidedTransparency, isShapeFullCube, isSideInvisible, isTransparent, mirror, neighborUpdate, onBlockAdded, onBlockBreakStart, onEntityCollision, onExploded, onProjectileHit, onStacksDropped, onStateReplaced, onSyncedBlockEvent, onUse, onUseWithItem, prepare, randomTick, rotate, scheduledTick
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeature
isEnabled
-
Field Details
-
CODEC
- Mappings:
Namespace Name Mixin selector named CODEC
Lnet/minecraft/block/Block;CODEC:Lcom/mojang/serialization/MapCodec;
intermediary field_46280
Lnet/minecraft/class_2248;field_46280:Lcom/mojang/serialization/MapCodec;
official p
Ldkl;p:Lcom/mojang/serialization/MapCodec;
-
LOGGER
- Mappings:
Namespace Name Mixin selector named LOGGER
Lnet/minecraft/block/Block;LOGGER:Lorg/slf4j/Logger;
intermediary field_10638
Lnet/minecraft/class_2248;field_10638:Lorg/slf4j/Logger;
official a
Ldkl;a:Lorg/slf4j/Logger;
-
STATE_IDS
- Mappings:
Namespace Name Mixin selector named STATE_IDS
Lnet/minecraft/block/Block;STATE_IDS:Lnet/minecraft/util/collection/IdList;
intermediary field_10651
Lnet/minecraft/class_2248;field_10651:Lnet/minecraft/class_2361;
official q
Ldkl;q:Ljw;
-
FULL_CUBE_SHAPE_CACHE
- Mappings:
Namespace Name Mixin selector named FULL_CUBE_SHAPE_CACHE
Lnet/minecraft/block/Block;FULL_CUBE_SHAPE_CACHE:Lcom/google/common/cache/LoadingCache;
intermediary field_19312
Lnet/minecraft/class_2248;field_19312:Lcom/google/common/cache/LoadingCache;
official c
Ldkl;c:Lcom/google/common/cache/LoadingCache;
-
NOTIFY_NEIGHBORS
public static final int NOTIFY_NEIGHBORSSends a neighbor update event to surrounding blocks.- See Also:
- Mappings:
Namespace Name Mixin selector named NOTIFY_NEIGHBORS
Lnet/minecraft/block/Block;NOTIFY_NEIGHBORS:I
intermediary field_31027
Lnet/minecraft/class_2248;field_31027:I
official r
Ldkl;r:I
-
NOTIFY_LISTENERS
public static final int NOTIFY_LISTENERSNotifies listeners and clients who need to react when the block changes.- See Also:
- Mappings:
Namespace Name Mixin selector named NOTIFY_LISTENERS
Lnet/minecraft/block/Block;NOTIFY_LISTENERS:I
intermediary field_31028
Lnet/minecraft/class_2248;field_31028:I
official s
Ldkl;s:I
-
NO_REDRAW
public static final int NO_REDRAWUsed in conjunction withNOTIFY_LISTENERS
to suppress the render pass on clients.- See Also:
- Mappings:
Namespace Name Mixin selector named NO_REDRAW
Lnet/minecraft/block/Block;NO_REDRAW:I
intermediary field_31029
Lnet/minecraft/class_2248;field_31029:I
official t
Ldkl;t:I
-
REDRAW_ON_MAIN_THREAD
public static final int REDRAW_ON_MAIN_THREADForces a synchronous redraw on clients.- See Also:
- Mappings:
Namespace Name Mixin selector named REDRAW_ON_MAIN_THREAD
Lnet/minecraft/block/Block;REDRAW_ON_MAIN_THREAD:I
intermediary field_31030
Lnet/minecraft/class_2248;field_31030:I
official u
Ldkl;u:I
-
FORCE_STATE
public static final int FORCE_STATEBypass virtual block state changes and forces the passed state to be stored as-is.- See Also:
- Mappings:
Namespace Name Mixin selector named FORCE_STATE
Lnet/minecraft/block/Block;FORCE_STATE:I
intermediary field_31031
Lnet/minecraft/class_2248;field_31031:I
official v
Ldkl;v:I
-
SKIP_DROPS
public static final int SKIP_DROPSPrevents the previous block (container) from dropping items when destroyed.- See Also:
- Mappings:
Namespace Name Mixin selector named SKIP_DROPS
Lnet/minecraft/block/Block;SKIP_DROPS:I
intermediary field_31032
Lnet/minecraft/class_2248;field_31032:I
official w
Ldkl;w:I
-
MOVED
public static final int MOVEDSignals that the current block is being moved to a different location, usually because of a piston.- See Also:
- Mappings:
Namespace Name Mixin selector named MOVED
Lnet/minecraft/block/Block;MOVED:I
intermediary field_31033
Lnet/minecraft/class_2248;field_31033:I
official x
Ldkl;x:I
-
SKIP_REDSTONE_WIRE_STATE_REPLACEMENT
public static final int SKIP_REDSTONE_WIRE_STATE_REPLACEMENT- See Also:
- Mappings:
Namespace Name Mixin selector named SKIP_REDSTONE_WIRE_STATE_REPLACEMENT
Lnet/minecraft/block/Block;SKIP_REDSTONE_WIRE_STATE_REPLACEMENT:I
intermediary field_53822
Lnet/minecraft/class_2248;field_53822:I
official y
Ldkl;y:I
-
field_31035
public static final int field_31035- See Also:
- Mappings:
Namespace Name Mixin selector named field_31035
Lnet/minecraft/block/Block;field_31035:I
intermediary field_31035
Lnet/minecraft/class_2248;field_31035:I
official z
Ldkl;z:I
-
NOTIFY_ALL
public static final int NOTIFY_ALLThe default setBlockState behavior. Same asNOTIFY_NEIGHBORS | NOTIFY_LISTENERS
.- See Also:
- Mappings:
Namespace Name Mixin selector named NOTIFY_ALL
Lnet/minecraft/block/Block;NOTIFY_ALL:I
intermediary field_31036
Lnet/minecraft/class_2248;field_31036:I
official A
Ldkl;A:I
-
NOTIFY_ALL_AND_REDRAW
public static final int NOTIFY_ALL_AND_REDRAWNotifies neighbors and listeners, and forces a redraw on clients. Same asNOTIFY_ALL | REDRAW_ON_MAIN_THREAD
- See Also:
- Mappings:
Namespace Name Mixin selector named NOTIFY_ALL_AND_REDRAW
Lnet/minecraft/block/Block;NOTIFY_ALL_AND_REDRAW:I
intermediary field_31022
Lnet/minecraft/class_2248;field_31022:I
official B
Ldkl;B:I
-
field_31023
public static final float field_31023- See Also:
- Mappings:
Namespace Name Mixin selector named field_31023
Lnet/minecraft/block/Block;field_31023:F
intermediary field_31023
Lnet/minecraft/class_2248;field_31023:F
official C
Ldkl;C:F
-
field_31024
public static final float field_31024- See Also:
- Mappings:
Namespace Name Mixin selector named field_31024
Lnet/minecraft/block/Block;field_31024:F
intermediary field_31024
Lnet/minecraft/class_2248;field_31024:F
official D
Ldkl;D:F
-
field_31025
public static final int field_31025- See Also:
- Mappings:
Namespace Name Mixin selector named field_31025
Lnet/minecraft/block/Block;field_31025:I
intermediary field_31025
Lnet/minecraft/class_2248;field_31025:I
official E
Ldkl;E:I
-
FACE_CULL_MAP_SIZE
private static final int FACE_CULL_MAP_SIZE- See Also:
- Mappings:
Namespace Name Mixin selector named FACE_CULL_MAP_SIZE
Lnet/minecraft/block/Block;FACE_CULL_MAP_SIZE:I
intermediary field_31026
Lnet/minecraft/class_2248;field_31026:I
official f
Ldkl;f:I
-
FACE_CULL_MAP
- Mappings:
Namespace Name Mixin selector named FACE_CULL_MAP
Lnet/minecraft/block/Block;FACE_CULL_MAP:Ljava/lang/ThreadLocal;
intermediary field_10649
Lnet/minecraft/class_2248;field_10649:Ljava/lang/ThreadLocal;
official g
Ldkl;g:Ljava/lang/ThreadLocal;
-
registryEntry
- Mappings:
Namespace Name Mixin selector named registryEntry
Lnet/minecraft/block/Block;registryEntry:Lnet/minecraft/registry/entry/RegistryEntry$Reference;
intermediary field_36404
Lnet/minecraft/class_2248;field_36404:Lnet/minecraft/class_6880$class_6883;
official b
Ldkl;b:Ljq$c;
-
stateManager
- Mappings:
Namespace Name Mixin selector named stateManager
Lnet/minecraft/block/Block;stateManager:Lnet/minecraft/state/StateManager;
intermediary field_10647
Lnet/minecraft/class_2248;field_10647:Lnet/minecraft/class_2689;
official F
Ldkl;F:Ldxv;
-
defaultState
- Mappings:
Namespace Name Mixin selector named defaultState
Lnet/minecraft/block/Block;defaultState:Lnet/minecraft/block/BlockState;
intermediary field_10646
Lnet/minecraft/class_2248;field_10646:Lnet/minecraft/class_2680;
official d
Ldkl;d:Ldxu;
-
cachedItem
- Mappings:
Namespace Name Mixin selector named cachedItem
Lnet/minecraft/block/Block;cachedItem:Lnet/minecraft/item/Item;
intermediary field_17562
Lnet/minecraft/class_2248;field_17562:Lnet/minecraft/class_1792;
official e
Ldkl;e:Lcxk;
-
-
Constructor Details
-
Block
- Mappings:
Namespace Name Mixin selector named <init>
Lnet/minecraft/block/AbstractBlock;<init>(Lnet/minecraft/block/AbstractBlock$Settings;)V
intermediary <init>
Lnet/minecraft/class_4970;<init>(Lnet/minecraft/class_4970$class_2251;)V
official <init>
Ldxt;<init>(Ldxt$d;)V
-
-
Method Details
-
getCodec
- Specified by:
getCodec
in classAbstractBlock
- Mappings:
Namespace Name Mixin selector named getCodec
Lnet/minecraft/block/AbstractBlock;getCodec()Lcom/mojang/serialization/MapCodec;
intermediary method_53969
Lnet/minecraft/class_4970;method_53969()Lcom/mojang/serialization/MapCodec;
official a
Ldxt;a()Lcom/mojang/serialization/MapCodec;
-
getRawIdFromState
- Mappings:
Namespace Name Mixin selector named getRawIdFromState
Lnet/minecraft/block/Block;getRawIdFromState(Lnet/minecraft/block/BlockState;)I
intermediary method_9507
Lnet/minecraft/class_2248;method_9507(Lnet/minecraft/class_2680;)I
official j
Ldkl;j(Ldxu;)I
-
getStateFromRawId
- Mappings:
Namespace Name Mixin selector named getStateFromRawId
Lnet/minecraft/block/Block;getStateFromRawId(I)Lnet/minecraft/block/BlockState;
intermediary method_9531
Lnet/minecraft/class_2248;method_9531(I)Lnet/minecraft/class_2680;
official a
Ldkl;a(I)Ldxu;
-
getBlockFromItem
- Mappings:
Namespace Name Mixin selector named getBlockFromItem
Lnet/minecraft/block/Block;getBlockFromItem(Lnet/minecraft/item/Item;)Lnet/minecraft/block/Block;
intermediary method_9503
Lnet/minecraft/class_2248;method_9503(Lnet/minecraft/class_1792;)Lnet/minecraft/class_2248;
official a
Ldkl;a(Lcxk;)Ldkl;
-
pushEntitiesUpBeforeBlockChange
public static BlockState pushEntitiesUpBeforeBlockChange(BlockState from, BlockState to, WorldAccess world, BlockPos pos) Pushes entities standing on a block up before changing the block to taller ones. Without calling this, entities can fall through the block. This only needs to be called if the original block's height is smaller than 1 block.- Returns:
- the passed new block state
- Mappings:
Namespace Name Mixin selector named pushEntitiesUpBeforeBlockChange
Lnet/minecraft/block/Block;pushEntitiesUpBeforeBlockChange(Lnet/minecraft/block/BlockState;Lnet/minecraft/block/BlockState;Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/block/BlockState;
intermediary method_9582
Lnet/minecraft/class_2248;method_9582(Lnet/minecraft/class_2680;Lnet/minecraft/class_2680;Lnet/minecraft/class_1936;Lnet/minecraft/class_2338;)Lnet/minecraft/class_2680;
official a
Ldkl;a(Ldxu;Ldxu;Ldhi;Ljh;)Ldxu;
-
createCuboidShape
public static VoxelShape createCuboidShape(double minX, double minY, double minZ, double maxX, double maxY, double maxZ) - Mappings:
Namespace Name Mixin selector named createCuboidShape
Lnet/minecraft/block/Block;createCuboidShape(DDDDDD)Lnet/minecraft/util/shape/VoxelShape;
intermediary method_9541
Lnet/minecraft/class_2248;method_9541(DDDDDD)Lnet/minecraft/class_265;
official a
Ldkl;a(DDDDDD)Lfcr;
-
postProcessState
- Mappings:
Namespace Name Mixin selector named postProcessState
Lnet/minecraft/block/Block;postProcessState(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/block/BlockState;
intermediary method_9510
Lnet/minecraft/class_2248;method_9510(Lnet/minecraft/class_2680;Lnet/minecraft/class_1936;Lnet/minecraft/class_2338;)Lnet/minecraft/class_2680;
official b
Ldkl;b(Ldxu;Ldhi;Ljh;)Ldxu;
-
replace
public static void replace(BlockState state, BlockState newState, WorldAccess world, BlockPos pos, int flags) Replaces thestate
with thenewState
at thepos
.If the two state objects are identical, this method does nothing.
If the new state is air, breaks the block at the position instead.
- Parameters:
state
- the existing block statenewState
- the new block stateworld
- the worldpos
- the position of the replaced block stateflags
- the bitwise flags forModifiableWorld.setBlockState(BlockPos, BlockState, int, int)
- Mappings:
Namespace Name Mixin selector named replace
Lnet/minecraft/block/Block;replace(Lnet/minecraft/block/BlockState;Lnet/minecraft/block/BlockState;Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;I)V
intermediary method_30094
Lnet/minecraft/class_2248;method_30094(Lnet/minecraft/class_2680;Lnet/minecraft/class_2680;Lnet/minecraft/class_1936;Lnet/minecraft/class_2338;I)V
official a
Ldkl;a(Ldxu;Ldxu;Ldhi;Ljh;I)V
-
replace
public static void replace(BlockState state, BlockState newState, WorldAccess world, BlockPos pos, int flags, int maxUpdateDepth) Replaces thestate
with thenewState
at thepos
.If the two state objects are identical, this method does nothing.
If the new state is air, breaks the block at the position instead.
- Parameters:
state
- the existing block statenewState
- the new block stateworld
- the worldpos
- the position of the replaced block stateflags
- the bitwise flags forModifiableWorld.setBlockState(BlockPos, BlockState, int, int)
maxUpdateDepth
- the limit for the cascading block updates- Mappings:
Namespace Name Mixin selector named replace
Lnet/minecraft/block/Block;replace(Lnet/minecraft/block/BlockState;Lnet/minecraft/block/BlockState;Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;II)V
intermediary method_9611
Lnet/minecraft/class_2248;method_9611(Lnet/minecraft/class_2680;Lnet/minecraft/class_2680;Lnet/minecraft/class_1936;Lnet/minecraft/class_2338;II)V
official a
Ldkl;a(Ldxu;Ldxu;Ldhi;Ljh;II)V
-
cannotConnect
- Mappings:
Namespace Name Mixin selector named cannotConnect
Lnet/minecraft/block/Block;cannotConnect(Lnet/minecraft/block/BlockState;)Z
intermediary method_9581
Lnet/minecraft/class_2248;method_9581(Lnet/minecraft/class_2680;)Z
official k
Ldkl;k(Ldxu;)Z
-
shouldDrawSide
- Mappings:
Namespace Name Mixin selector named shouldDrawSide
Lnet/minecraft/block/Block;shouldDrawSide(Lnet/minecraft/block/BlockState;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/Direction;)Z
intermediary method_9607
Lnet/minecraft/class_2248;method_9607(Lnet/minecraft/class_2680;Lnet/minecraft/class_2680;Lnet/minecraft/class_2350;)Z
official a
Ldkl;a(Ldxu;Ldxu;Ljm;)Z
-
hasTopRim
- Mappings:
Namespace Name Mixin selector named hasTopRim
Lnet/minecraft/block/Block;hasTopRim(Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;)Z
intermediary method_16361
Lnet/minecraft/class_2248;method_16361(Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;)Z
official c
Ldkl;c(Ldgm;Ljh;)Z
-
sideCoversSmallSquare
- Mappings:
Namespace Name Mixin selector named sideCoversSmallSquare
Lnet/minecraft/block/Block;sideCoversSmallSquare(Lnet/minecraft/world/WorldView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;)Z
intermediary method_20044
Lnet/minecraft/class_2248;method_20044(Lnet/minecraft/class_4538;Lnet/minecraft/class_2338;Lnet/minecraft/class_2350;)Z
official a
Ldkl;a(Ldhk;Ljh;Ljm;)Z
-
isFaceFullSquare
- Mappings:
Namespace Name Mixin selector named isFaceFullSquare
Lnet/minecraft/block/Block;isFaceFullSquare(Lnet/minecraft/util/shape/VoxelShape;Lnet/minecraft/util/math/Direction;)Z
intermediary method_9501
Lnet/minecraft/class_2248;method_9501(Lnet/minecraft/class_265;Lnet/minecraft/class_2350;)Z
official a
Ldkl;a(Lfcr;Ljm;)Z
-
isShapeFullCube
- Mappings:
Namespace Name Mixin selector named isShapeFullCube
Lnet/minecraft/block/Block;isShapeFullCube(Lnet/minecraft/util/shape/VoxelShape;)Z
intermediary method_9614
Lnet/minecraft/class_2248;method_9614(Lnet/minecraft/class_265;)Z
official a
Ldkl;a(Lfcr;)Z
-
randomDisplayTick
Called randomly on the client. Blocks may override this to spawn particles. UnlikeAbstractBlock.randomTick(net.minecraft.block.BlockState, net.minecraft.server.world.ServerWorld, net.minecraft.util.math.BlockPos, net.minecraft.util.math.random.Random)
this is not affected by a game rule.- Mappings:
Namespace Name Mixin selector named randomDisplayTick
Lnet/minecraft/block/Block;randomDisplayTick(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/random/Random;)V
intermediary method_9496
Lnet/minecraft/class_2248;method_9496(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_5819;)V
official a
Ldkl;a(Ldxu;Ldhh;Ljh;Lbam;)V
-
onBroken
Called after a player breaks a block and the block is removed from the world. Explosions do not trigger this.In most cases,
AbstractBlock.onStateReplaced(net.minecraft.block.BlockState, net.minecraft.world.World, net.minecraft.util.math.BlockPos, net.minecraft.block.BlockState, boolean)
orAbstractBlock.onStacksDropped(net.minecraft.block.BlockState, net.minecraft.server.world.ServerWorld, net.minecraft.util.math.BlockPos, net.minecraft.item.ItemStack, boolean)
should be used instead. Note that they are called when blocks are broken by explosions as well as players breaking them.This method is called on both the logical client and logical server, so take caution when overriding this method. The logical side can be checked using
World.isClient
.- See Also:
- Mappings:
Namespace Name Mixin selector named onBroken
Lnet/minecraft/block/Block;onBroken(Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
intermediary method_9585
Lnet/minecraft/class_2248;method_9585(Lnet/minecraft/class_1936;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
official a
Ldkl;a(Ldhi;Ljh;Ldxu;)V
-
getDroppedStacks
public static List<ItemStack> getDroppedStacks(BlockState state, ServerWorld world, BlockPos pos, @Nullable @Nullable BlockEntity blockEntity) - Mappings:
Namespace Name Mixin selector named getDroppedStacks
Lnet/minecraft/block/Block;getDroppedStacks(Lnet/minecraft/block/BlockState;Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/entity/BlockEntity;)Ljava/util/List;
intermediary method_9562
Lnet/minecraft/class_2248;method_9562(Lnet/minecraft/class_2680;Lnet/minecraft/class_3218;Lnet/minecraft/class_2338;Lnet/minecraft/class_2586;)Ljava/util/List;
official a
Ldkl;a(Ldxu;Lash;Ljh;Lduw;)Ljava/util/List;
-
getDroppedStacks
public static List<ItemStack> getDroppedStacks(BlockState state, ServerWorld world, BlockPos pos, @Nullable @Nullable BlockEntity blockEntity, @Nullable @Nullable Entity entity, ItemStack stack) - Mappings:
Namespace Name Mixin selector named getDroppedStacks
Lnet/minecraft/block/Block;getDroppedStacks(Lnet/minecraft/block/BlockState;Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/entity/BlockEntity;Lnet/minecraft/entity/Entity;Lnet/minecraft/item/ItemStack;)Ljava/util/List;
intermediary method_9609
Lnet/minecraft/class_2248;method_9609(Lnet/minecraft/class_2680;Lnet/minecraft/class_3218;Lnet/minecraft/class_2338;Lnet/minecraft/class_2586;Lnet/minecraft/class_1297;Lnet/minecraft/class_1799;)Ljava/util/List;
official a
Ldkl;a(Ldxu;Lash;Ljh;Lduw;Lbvj;Lcxo;)Ljava/util/List;
-
dropStacks
- Mappings:
Namespace Name Mixin selector named dropStacks
Lnet/minecraft/block/Block;dropStacks(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)V
intermediary method_9497
Lnet/minecraft/class_2248;method_9497(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;)V
official c
Ldkl;c(Ldxu;Ldhh;Ljh;)V
-
dropStacks
public static void dropStacks(BlockState state, WorldAccess world, BlockPos pos, @Nullable @Nullable BlockEntity blockEntity) - Mappings:
Namespace Name Mixin selector named dropStacks
Lnet/minecraft/block/Block;dropStacks(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/entity/BlockEntity;)V
intermediary method_9610
Lnet/minecraft/class_2248;method_9610(Lnet/minecraft/class_2680;Lnet/minecraft/class_1936;Lnet/minecraft/class_2338;Lnet/minecraft/class_2586;)V
official a
Ldkl;a(Ldxu;Ldhi;Ljh;Lduw;)V
-
dropStacks
public static void dropStacks(BlockState state, World world, BlockPos pos, @Nullable @Nullable BlockEntity blockEntity, @Nullable @Nullable Entity entity, ItemStack tool) - Mappings:
Namespace Name Mixin selector named dropStacks
Lnet/minecraft/block/Block;dropStacks(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/entity/BlockEntity;Lnet/minecraft/entity/Entity;Lnet/minecraft/item/ItemStack;)V
intermediary method_9511
Lnet/minecraft/class_2248;method_9511(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2586;Lnet/minecraft/class_1297;Lnet/minecraft/class_1799;)V
official a
Ldkl;a(Ldxu;Ldhh;Ljh;Lduw;Lbvj;Lcxo;)V
-
dropStack
- Mappings:
Namespace Name Mixin selector named dropStack
Lnet/minecraft/block/Block;dropStack(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/item/ItemStack;)V
intermediary method_9577
Lnet/minecraft/class_2248;method_9577(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1799;)V
official a
Ldkl;a(Ldhh;Ljh;Lcxo;)V
-
dropStack
- Mappings:
Namespace Name Mixin selector named dropStack
Lnet/minecraft/block/Block;dropStack(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;Lnet/minecraft/item/ItemStack;)V
intermediary method_36992
Lnet/minecraft/class_2248;method_36992(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2350;Lnet/minecraft/class_1799;)V
official a
Ldkl;a(Ldhh;Ljh;Ljm;Lcxo;)V
-
dropStack
private static void dropStack(World world, Supplier<ItemEntity> itemEntitySupplier, ItemStack stack) - Mappings:
Namespace Name Mixin selector named dropStack
Lnet/minecraft/block/Block;dropStack(Lnet/minecraft/world/World;Ljava/util/function/Supplier;Lnet/minecraft/item/ItemStack;)V
intermediary method_36993
Lnet/minecraft/class_2248;method_36993(Lnet/minecraft/class_1937;Ljava/util/function/Supplier;Lnet/minecraft/class_1799;)V
official a
Ldkl;a(Ldhh;Ljava/util/function/Supplier;Lcxo;)V
-
dropExperience
Drops experience orbs. This should be called insideAbstractBlock.onStacksDropped(net.minecraft.block.BlockState, net.minecraft.server.world.ServerWorld, net.minecraft.util.math.BlockPos, net.minecraft.item.ItemStack, boolean)
afterdropExperience
check. This does not drop experience orbs ifdoTileDrops
is turned off. For blocks that do not drop experience when mined with Silk Touch, consider callingdropExperienceWhenMined(net.minecraft.server.world.ServerWorld, net.minecraft.util.math.BlockPos, net.minecraft.item.ItemStack, net.minecraft.util.math.intprovider.IntProvider)
instead.- See Also:
- Mappings:
Namespace Name Mixin selector named dropExperience
Lnet/minecraft/block/Block;dropExperience(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/math/BlockPos;I)V
intermediary method_9583
Lnet/minecraft/class_2248;method_9583(Lnet/minecraft/class_3218;Lnet/minecraft/class_2338;I)V
official a
Ldkl;a(Lash;Ljh;I)V
-
getBlastResistance
public float getBlastResistance()- Mappings:
Namespace Name Mixin selector named getBlastResistance
Lnet/minecraft/block/Block;getBlastResistance()F
intermediary method_9520
Lnet/minecraft/class_2248;method_9520()F
official e
Ldkl;e()F
-
onDestroyedByExplosion
Called when this block is destroyed by an explosion.This method is called on both the logical client and logical server, so take caution when overriding this method. The logical side can be checked using
World.isClient
.- Mappings:
Namespace Name Mixin selector named onDestroyedByExplosion
Lnet/minecraft/block/Block;onDestroyedByExplosion(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/world/explosion/Explosion;)V
intermediary method_9586
Lnet/minecraft/class_2248;method_9586(Lnet/minecraft/class_3218;Lnet/minecraft/class_2338;Lnet/minecraft/class_1927;)V
official a
Ldkl;a(Lash;Ljh;Ldgz;)V
-
onSteppedOn
Called when an entity steps on this block.This method is called on both the logical client and logical server, so take caution when overriding this method. The logical side can be checked using
World.isClient
.- Mappings:
Namespace Name Mixin selector named onSteppedOn
Lnet/minecraft/block/Block;onSteppedOn(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/entity/Entity;)V
intermediary method_9591
Lnet/minecraft/class_2248;method_9591(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Lnet/minecraft/class_1297;)V
official a
Ldkl;a(Ldhh;Ljh;Ldxu;Lbvj;)V
-
getPlacementState
- Mappings:
Namespace Name Mixin selector named getPlacementState
Lnet/minecraft/block/Block;getPlacementState(Lnet/minecraft/item/ItemPlacementContext;)Lnet/minecraft/block/BlockState;
intermediary method_9605
Lnet/minecraft/class_2248;method_9605(Lnet/minecraft/class_1750;)Lnet/minecraft/class_2680;
official a
Ldkl;a(Ldbf;)Ldxu;
-
afterBreak
public void afterBreak(World world, PlayerEntity player, BlockPos pos, BlockState state, @Nullable @Nullable BlockEntity blockEntity, ItemStack tool) Called server-side when the block is broken by the player using correct tool. This is called afteronBroken(net.minecraft.world.WorldAccess, net.minecraft.util.math.BlockPos, net.minecraft.block.BlockState)
but has the tool requirement. By default, this incrementsStats.MINED
, adds exhaustion to the player, and drops the block's item stacks.Subclasses should override this if breaking the block causes another block to be placed (like
IceBlock
) or if the block can break multiple times (likeTurtleEggBlock
).BeehiveBlock
uses this to anger the bees if the hive is mined without silk touch.- See Also:
- Mappings:
Namespace Name Mixin selector named afterBreak
Lnet/minecraft/block/Block;afterBreak(Lnet/minecraft/world/World;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/block/entity/BlockEntity;Lnet/minecraft/item/ItemStack;)V
intermediary method_9556
Lnet/minecraft/class_2248;method_9556(Lnet/minecraft/class_1937;Lnet/minecraft/class_1657;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Lnet/minecraft/class_2586;Lnet/minecraft/class_1799;)V
official a
Ldkl;a(Ldhh;Lcpw;Ljh;Ldxu;Lduw;Lcxo;)V
-
onPlaced
public void onPlaced(World world, BlockPos pos, BlockState state, @Nullable @Nullable LivingEntity placer, ItemStack itemStack) Called when the player placed the block.Tall or wide blocks (such as doors or beds) should override this to place the other half of the block. Blocks with block entities can use this to copy the data from the item stack, such as the custom name.
This method is called on both the logical client and logical server, so take caution when overriding this method. The logical side can be checked using
World.isClient
.- See Also:
- Mappings:
Namespace Name Mixin selector named onPlaced
Lnet/minecraft/block/Block;onPlaced(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/item/ItemStack;)V
intermediary method_9567
Lnet/minecraft/class_2248;method_9567(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Lnet/minecraft/class_1309;Lnet/minecraft/class_1799;)V
official a
Ldkl;a(Ldhh;Ljh;Ldxu;Lbwf;Lcxo;)V
-
canMobSpawnInside
- Mappings:
Namespace Name Mixin selector named canMobSpawnInside
Lnet/minecraft/block/Block;canMobSpawnInside(Lnet/minecraft/block/BlockState;)Z
intermediary method_9538
Lnet/minecraft/class_2248;method_9538(Lnet/minecraft/class_2680;)Z
official a
Ldkl;a(Ldxu;)Z
-
getName
- Mappings:
Namespace Name Mixin selector named getName
Lnet/minecraft/block/Block;getName()Lnet/minecraft/text/MutableText;
intermediary method_9518
Lnet/minecraft/class_2248;method_9518()Lnet/minecraft/class_5250;
official f
Ldkl;f()Lyj;
-
onLandedUpon
public void onLandedUpon(World world, BlockState state, BlockPos pos, Entity entity, float fallDistance) Called when the entity lands on the block.Default implementation deals fall damage to the entity. Blocks that increase or reduce fall damage (like
HayBlock
) should override this.FarmlandBlock
overrides this method to convert the block to dirt.This method is called on both the logical client and logical server, so take caution when overriding this method. The logical side can be checked using
World.isClient
.- Mappings:
Namespace Name Mixin selector named onLandedUpon
Lnet/minecraft/block/Block;onLandedUpon(Lnet/minecraft/world/World;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/Entity;F)V
intermediary method_9554
Lnet/minecraft/class_2248;method_9554(Lnet/minecraft/class_1937;Lnet/minecraft/class_2680;Lnet/minecraft/class_2338;Lnet/minecraft/class_1297;F)V
official a
Ldkl;a(Ldhh;Ldxu;Ljh;Lbvj;F)V
-
onEntityLand
Called after the entity lands on the block.Default implementation resets the entity's vertical velocity. Blocks that cause entities to jump (such as
SlimeBlock
) should override this.This method is called on both the logical client and logical server, so take caution when overriding this method. The logical side can be checked using
World.isClient
.- Mappings:
Namespace Name Mixin selector named onEntityLand
Lnet/minecraft/block/Block;onEntityLand(Lnet/minecraft/world/BlockView;Lnet/minecraft/entity/Entity;)V
intermediary method_9502
Lnet/minecraft/class_2248;method_9502(Lnet/minecraft/class_1922;Lnet/minecraft/class_1297;)V
official a
Ldkl;a(Ldgm;Lbvj;)V
-
getPickStack
Returns the new item stack when using pick block functionality.Pick block is available via middle-clicking by default. Blocks without the corresponding
BlockItem
, such as crops, should override this method to return the correct item stack.- Returns:
- the new item stack when using pick block functionality
- Mappings:
Namespace Name Mixin selector named getPickStack
Lnet/minecraft/block/Block;getPickStack(Lnet/minecraft/world/WorldView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Lnet/minecraft/item/ItemStack;
intermediary method_9574
Lnet/minecraft/class_2248;method_9574(Lnet/minecraft/class_4538;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Lnet/minecraft/class_1799;
official a
Ldkl;a(Ldhk;Ljh;Ldxu;)Lcxo;
-
getSlipperiness
public float getSlipperiness()- Mappings:
Namespace Name Mixin selector named getSlipperiness
Lnet/minecraft/block/Block;getSlipperiness()F
intermediary method_9499
Lnet/minecraft/class_2248;method_9499()F
official g
Ldkl;g()F
-
getVelocityMultiplier
public float getVelocityMultiplier()- Mappings:
Namespace Name Mixin selector named getVelocityMultiplier
Lnet/minecraft/block/Block;getVelocityMultiplier()F
intermediary method_23349
Lnet/minecraft/class_2248;method_23349()F
official h
Ldkl;h()F
-
getJumpVelocityMultiplier
public float getJumpVelocityMultiplier()- Mappings:
Namespace Name Mixin selector named getJumpVelocityMultiplier
Lnet/minecraft/block/Block;getJumpVelocityMultiplier()F
intermediary method_23350
Lnet/minecraft/class_2248;method_23350()F
official k
Ldkl;k()F
-
spawnBreakParticles
protected void spawnBreakParticles(World world, PlayerEntity player, BlockPos pos, BlockState state) - Mappings:
Namespace Name Mixin selector named spawnBreakParticles
Lnet/minecraft/block/Block;spawnBreakParticles(Lnet/minecraft/world/World;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
intermediary method_33614
Lnet/minecraft/class_2248;method_33614(Lnet/minecraft/class_1937;Lnet/minecraft/class_1657;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
official a
Ldkl;a(Ldhh;Lcpw;Ljh;Ldxu;)V
-
onBreak
Called when a player breaks a block before the block is removed from the world. Explosions do not trigger this.Default implementation spawns block breaking particles, angers piglins, and emits game events. Tall or wide blocks such as doors or beds should override this to break the other part (along with
AbstractBlock.getStateForNeighborUpdate(net.minecraft.block.BlockState, net.minecraft.world.WorldView, net.minecraft.world.tick.ScheduledTickView, net.minecraft.util.math.BlockPos, net.minecraft.util.math.Direction, net.minecraft.util.math.BlockPos, net.minecraft.block.BlockState, net.minecraft.util.math.random.Random)
.)In most cases,
AbstractBlock.onStateReplaced(net.minecraft.block.BlockState, net.minecraft.world.World, net.minecraft.util.math.BlockPos, net.minecraft.block.BlockState, boolean)
orAbstractBlock.onStacksDropped(net.minecraft.block.BlockState, net.minecraft.server.world.ServerWorld, net.minecraft.util.math.BlockPos, net.minecraft.item.ItemStack, boolean)
should be used instead. Note that they are called when blocks are broken by explosions as well as players breaking them.This method is called on both the logical client and logical server, so take caution when overriding this method. The logical side can be checked using
World.isClient
.- See Also:
- Mappings:
Namespace Name Mixin selector named onBreak
Lnet/minecraft/block/Block;onBreak(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/entity/player/PlayerEntity;)Lnet/minecraft/block/BlockState;
intermediary method_9576
Lnet/minecraft/class_2248;method_9576(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Lnet/minecraft/class_1657;)Lnet/minecraft/class_2680;
official a
Ldkl;a(Ldhh;Ljh;Ldxu;Lcpw;)Ldxu;
-
precipitationTick
public void precipitationTick(BlockState state, World world, BlockPos pos, Biome.Precipitation precipitation) Called randomly server-side on blocks with unobstructed sky access when it is raining or snowing. Like random ticks, only blocks within 128-block cylinder (i.e. ignoring Y coordinates) around players receive precipitation ticks. However, precipitation ticks are unaffected by therandomTickSpeed
game rule, andAbstractBlock.Settings.ticksRandomly()
block setting is not required.LeveledCauldronBlock
uses this to fill the cauldron.- Parameters:
precipitation
- the precipitation (snow or rain), including snow observable on high altitude- Mappings:
Namespace Name Mixin selector named precipitationTick
Lnet/minecraft/block/Block;precipitationTick(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/world/biome/Biome$Precipitation;)V
intermediary method_9504
Lnet/minecraft/class_2248;method_9504(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1959$class_1963;)V
official a
Ldkl;a(Ldxu;Ldhh;Ljh;Ldij$c;)V
-
shouldDropItemsOnExplosion
Returns whether an explosion can drop the block as an item.This should be overridden if an explosion affects the block in other ways, like
TntBlock
that triggers the chain reaction. This should not consider the randomness, since it is defined in the loot table.- Returns:
- whether an explosion can drop the block as an item
- See Also:
- Mappings:
Namespace Name Mixin selector named shouldDropItemsOnExplosion
Lnet/minecraft/block/Block;shouldDropItemsOnExplosion(Lnet/minecraft/world/explosion/Explosion;)Z
intermediary method_9533
Lnet/minecraft/class_2248;method_9533(Lnet/minecraft/class_1927;)Z
official a
Ldkl;a(Ldgz;)Z
-
appendProperties
Appends block state properties to this block. To use this, override and callStateManager.Builder.add(net.minecraft.state.property.Property<?>[])
inside the method. SeeProperties
for the list of pre-defined properties.- Mappings:
Namespace Name Mixin selector named appendProperties
Lnet/minecraft/block/Block;appendProperties(Lnet/minecraft/state/StateManager$Builder;)V
intermediary method_9515
Lnet/minecraft/class_2248;method_9515(Lnet/minecraft/class_2689$class_2690;)V
official a
Ldkl;a(Ldxv$a;)V
-
getStateManager
- Mappings:
Namespace Name Mixin selector named getStateManager
Lnet/minecraft/block/Block;getStateManager()Lnet/minecraft/state/StateManager;
intermediary method_9595
Lnet/minecraft/class_2248;method_9595()Lnet/minecraft/class_2689;
official l
Ldkl;l()Ldxv;
-
setDefaultState
Sets the default state of the block. This should be called inside the block's constructor to override the default state chosen by the state manager.- Mappings:
Namespace Name Mixin selector named setDefaultState
Lnet/minecraft/block/Block;setDefaultState(Lnet/minecraft/block/BlockState;)V
intermediary method_9590
Lnet/minecraft/class_2248;method_9590(Lnet/minecraft/class_2680;)V
official l
Ldkl;l(Ldxu;)V
-
getDefaultState
- Mappings:
Namespace Name Mixin selector named getDefaultState
Lnet/minecraft/block/Block;getDefaultState()Lnet/minecraft/block/BlockState;
intermediary method_9564
Lnet/minecraft/class_2248;method_9564()Lnet/minecraft/class_2680;
official m
Ldkl;m()Ldxu;
-
getStateWithProperties
Gets a block state with all properties that both this block and the source block state have.- Mappings:
Namespace Name Mixin selector named getStateWithProperties
Lnet/minecraft/block/Block;getStateWithProperties(Lnet/minecraft/block/BlockState;)Lnet/minecraft/block/BlockState;
intermediary method_34725
Lnet/minecraft/class_2248;method_34725(Lnet/minecraft/class_2680;)Lnet/minecraft/class_2680;
official m
Ldkl;m(Ldxu;)Ldxu;
-
copyProperty
private static <T extends Comparable<T>> BlockState copyProperty(BlockState source, BlockState target, Property<T> property) - Mappings:
Namespace Name Mixin selector named copyProperty
Lnet/minecraft/block/Block;copyProperty(Lnet/minecraft/block/BlockState;Lnet/minecraft/block/BlockState;Lnet/minecraft/state/property/Property;)Lnet/minecraft/block/BlockState;
intermediary method_34724
Lnet/minecraft/class_2248;method_34724(Lnet/minecraft/class_2680;Lnet/minecraft/class_2680;Lnet/minecraft/class_2769;)Lnet/minecraft/class_2680;
official a
Ldkl;a(Ldxu;Ldxu;Ldyw;)Ldxu;
-
asItem
Returns the block's corresponding item.This is not affected by loot tables. Blocks without corresponding items, such as piston head, will return
Items.AIR
.- Specified by:
asItem
in interfaceItemConvertible
- Specified by:
asItem
in classAbstractBlock
- Returns:
- the block's corresponding item
- See Also:
- Mappings:
Namespace Name Mixin selector named asItem
Lnet/minecraft/block/AbstractBlock;asItem()Lnet/minecraft/item/Item;
intermediary method_8389
Lnet/minecraft/class_4970;method_8389()Lnet/minecraft/class_1792;
official j
Ldxt;j()Lcxk;
-
hasDynamicBounds
public boolean hasDynamicBounds()- Mappings:
Namespace Name Mixin selector named hasDynamicBounds
Lnet/minecraft/block/Block;hasDynamicBounds()Z
intermediary method_9543
Lnet/minecraft/class_2248;method_9543()Z
official n
Ldkl;n()Z
-
toString
-
appendTooltip
public void appendTooltip(ItemStack stack, Item.TooltipContext context, List<Text> tooltip, TooltipType options) Appends tooltips to a stack of this block's corresponding block item. Used by shulker boxes.- See Also:
- Mappings:
Namespace Name Mixin selector named appendTooltip
Lnet/minecraft/block/Block;appendTooltip(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/Item$TooltipContext;Ljava/util/List;Lnet/minecraft/item/tooltip/TooltipType;)V
intermediary method_9568
Lnet/minecraft/class_2248;method_9568(Lnet/minecraft/class_1799;Lnet/minecraft/class_1792$class_9635;Ljava/util/List;Lnet/minecraft/class_1836;)V
official a
Ldkl;a(Lcxo;Lcxk$b;Ljava/util/List;Lczg;)V
-
asBlock
Returns the block asBlock
.This is used for casting purposes.
- Specified by:
asBlock
in classAbstractBlock
- Returns:
- the block as
Block
- Mappings:
Namespace Name Mixin selector named asBlock
Lnet/minecraft/block/AbstractBlock;asBlock()Lnet/minecraft/block/Block;
intermediary method_26160
Lnet/minecraft/class_4970;method_26160()Lnet/minecraft/class_2248;
official o
Ldxt;o()Ldkl;
-
getShapesForStates
protected ImmutableMap<BlockState,VoxelShape> getShapesForStates(Function<BlockState, VoxelShape> stateToShape) - Mappings:
Namespace Name Mixin selector named getShapesForStates
Lnet/minecraft/block/Block;getShapesForStates(Ljava/util/function/Function;)Lcom/google/common/collect/ImmutableMap;
intermediary method_33615
Lnet/minecraft/class_2248;method_33615(Ljava/util/function/Function;)Lcom/google/common/collect/ImmutableMap;
official a
Ldkl;a(Ljava/util/function/Function;)Lcom/google/common/collect/ImmutableMap;
-
getRegistryEntry
Deprecated.- Mappings:
Namespace Name Mixin selector named getRegistryEntry
Lnet/minecraft/block/Block;getRegistryEntry()Lnet/minecraft/registry/entry/RegistryEntry$Reference;
intermediary method_40142
Lnet/minecraft/class_2248;method_40142()Lnet/minecraft/class_6880$class_6883;
official p
Ldkl;p()Ljq$c;
-
dropExperienceWhenMined
protected void dropExperienceWhenMined(ServerWorld world, BlockPos pos, ItemStack tool, IntProvider experience) Drops experience orbs. This should be called insideAbstractBlock.onStacksDropped(net.minecraft.block.BlockState, net.minecraft.server.world.ServerWorld, net.minecraft.util.math.BlockPos, net.minecraft.item.ItemStack, boolean)
afterdropExperience
check. This does not drop experience orbs iftool
is enchanted with silk touch or ifdoTileDrops
is turned off.- Parameters:
tool
- the tool used to break the block, orItemStack.EMPTY
for explosions- See Also:
- Mappings:
Namespace Name Mixin selector named dropExperienceWhenMined
Lnet/minecraft/block/Block;dropExperienceWhenMined(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/item/ItemStack;Lnet/minecraft/util/math/intprovider/IntProvider;)V
intermediary method_41420
Lnet/minecraft/class_2248;method_41420(Lnet/minecraft/class_3218;Lnet/minecraft/class_2338;Lnet/minecraft/class_1799;Lnet/minecraft/class_6017;)V
official a
Ldkl;a(Lash;Ljh;Lcxo;Lbsn;)V
-