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,MultifaceBlock,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,TerracottaBlock,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/Blockintermediary net/minecraft/class_2248official dno
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class net.minecraft.block.AbstractBlock
AbstractBlock.AbstractBlockState, AbstractBlock.ContextPredicate, AbstractBlock.Offsetter, AbstractBlock.OffsetType, AbstractBlock.Settings, AbstractBlock.TypedContextPredicate<A> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<Block> private BlockStateprivate static final ThreadLocal<Object2ByteLinkedOpenHashMap<Block.VoxelShapePair>> private static final intstatic final floatstatic final floatstatic final intstatic final intBypass virtual block state changes and forces the passed state to be stored as-is.static final intUsed for 'strict' block placement by commands and structures.private static final LoadingCache<VoxelShape, Boolean> private static final Loggerstatic final intSignals that the current block is being moved to a different location, usually because of a piston.static final intUsed in conjunction withNOTIFY_LISTENERSto suppress the render pass on clients.static final intThe default setBlockState behavior.static final intNotifies neighbors and listeners, and forces a redraw on clients.static final intNotifies listeners and clients who need to react when the block changes.static final intSends a neighbor update event to surrounding blocks.static final intForces a synchronous redraw on clients.private final RegistryEntry.Reference<Block> static final intstatic final intstatic final intPrevents the previous block (container) from dropping items when destroyed.static final intstatic final intstatic 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, velocityMultiplierFields inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeature
FEATURE_ENABLED_REGISTRY_KEYS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterBreak(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 voidappendProperties(StateManager.Builder<Block, BlockState> builder) Appends block state properties to this block.private static <S extends State<?,S>, T extends Comparable<T>>
SapplyValueToState(S state, Property<T> property, Object value) protected BlockasBlock()Returns the block asBlock.asItem()Returns the block's corresponding item.booleancanMobSpawnInside(BlockState state) static booleancannotConnect(BlockState state) private static <T extends Comparable<T>>
BlockStatecopyProperty(BlockState source, BlockState target, Property<T> property) static VoxelShapecreateColumnShape(double sizeXz, double minY, double maxY) static VoxelShapecreateColumnShape(double sizeX, double sizeZ, double minY, double maxY) static VoxelShapecreateCubeShape(double size) static VoxelShapecreateCuboidShape(double sizeX, double sizeY, double sizeZ) static VoxelShapecreateCuboidShape(double minX, double minY, double minZ, double maxX, double maxY, double maxZ) static VoxelShapecreateCuboidZShape(double sizeXy, double minZ, double maxZ) static VoxelShapecreateCuboidZShape(double sizeX, double sizeY, double minZ, double maxZ) static VoxelShapecreateCuboidZShape(double sizeX, double minY, double maxY, double minZ, double maxZ) static VoxelShape[]createShapeArray(int size, IntFunction<VoxelShape> indexToShape) protected Function<BlockState, VoxelShape> createShapeFunction(Function<BlockState, VoxelShape> stateToShape) protected Function<BlockState, VoxelShape> createShapeFunction(Function<BlockState, VoxelShape> stateToShape, Property<?>[] properties) protected voiddropExperience(ServerWorld world, BlockPos pos, int size) Drops experience orbs.protected voiddropExperienceWhenMined(ServerWorld world, BlockPos pos, ItemStack tool, IntProvider experience) Drops experience orbs.private static voiddropStack(World world, Supplier<ItemEntity> itemEntitySupplier, ItemStack stack) static voidstatic voidstatic voiddropStacks(BlockState state, WorldAccess world, BlockPos pos, @Nullable BlockEntity blockEntity) static voiddropStacks(BlockState state, World world, BlockPos pos) static voiddropStacks(BlockState state, World world, BlockPos pos, @Nullable BlockEntity blockEntity, @Nullable Entity entity, ItemStack tool) floatstatic BlockgetBlockFromItem(@Nullable Item item) protected com.mojang.serialization.MapCodec<? extends Block> getCodec()final BlockStategetDroppedStacks(BlockState state, ServerWorld world, BlockPos pos, @Nullable BlockEntity blockEntity) getDroppedStacks(BlockState state, ServerWorld world, BlockPos pos, @Nullable BlockEntity blockEntity, @Nullable Entity entity, ItemStack stack) floatgetName()static intgetRawIdFromState(@Nullable BlockState state) Deprecated.floatstatic BlockStategetStateFromRawId(int stateId) final BlockStategetStateWithProperties(BlockState state) Gets a block state with all properties that both this block and the source block state have.floatbooleanstatic booleanstatic booleanisFaceFullSquare(VoxelShape shape, Direction side) static booleanisShapeFullCube(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.voidonBroken(WorldAccess world, BlockPos pos, BlockState state) Called after a player breaks a block and the block is removed from the world.voidonDestroyedByExplosion(ServerWorld world, BlockPos pos, Explosion explosion) Called when this block is destroyed by an explosion.voidonEntityLand(BlockView world, Entity entity) Called after the entity lands on the block.voidonLandedUpon(World world, BlockState state, BlockPos pos, Entity entity, double fallDistance) Called when the entity lands on the block.voidonPlaced(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) Called when the player placed the block.voidonSteppedOn(World world, BlockPos pos, BlockState state, Entity entity) Called when an entity steps on this block.static BlockStatepostProcessState(BlockState state, WorldAccess world, BlockPos pos) voidprecipitationTick(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 BlockStatepushEntitiesUpBeforeBlockChange(BlockState from, BlockState to, WorldAccess world, BlockPos pos) Pushes entities standing on a block up before changing the block to taller ones.voidrandomDisplayTick(BlockState state, World world, BlockPos pos, Random random) Called randomly on the client.static voidreplace(BlockState state, BlockState newState, WorldAccess world, BlockPos pos, int flags) Replaces thestatewith thenewStateat thepos.static voidreplace(BlockState state, BlockState newState, WorldAccess world, BlockPos pos, int flags, int maxUpdateDepth) Replaces thestatewith thenewStateat thepos.protected final voidsetDefaultState(BlockState state) Sets the default state of the block.static booleanshouldDrawSide(BlockState state, BlockState otherState, Direction side) booleanshouldDropItemsOnExplosion(Explosion explosion) Returns whether an explosion can drop the block as an item.static booleansideCoversSmallSquare(WorldView world, BlockPos pos, Direction side) protected voidspawnBreakParticles(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, getPickStack, 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, scheduledTickMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeature
isEnabled
-
Field Details
-
CODEC
- Mappings:
Namespace Name Mixin selector named CODECLnet/minecraft/block/Block;CODEC:Lcom/mojang/serialization/MapCodec;intermediary field_46280Lnet/minecraft/class_2248;field_46280:Lcom/mojang/serialization/MapCodec;official jLdno;j:Lcom/mojang/serialization/MapCodec;
-
LOGGER
- Mappings:
Namespace Name Mixin selector named LOGGERLnet/minecraft/block/Block;LOGGER:Lorg/slf4j/Logger;intermediary field_10638Lnet/minecraft/class_2248;field_10638:Lorg/slf4j/Logger;official aLdno;a:Lorg/slf4j/Logger;
-
STATE_IDS
- Mappings:
Namespace Name Mixin selector named STATE_IDSLnet/minecraft/block/Block;STATE_IDS:Lnet/minecraft/util/collection/IdList;intermediary field_10651Lnet/minecraft/class_2248;field_10651:Lnet/minecraft/class_2361;official kLdno;k:Ljm;
-
FULL_CUBE_SHAPE_CACHE
- Mappings:
Namespace Name Mixin selector named FULL_CUBE_SHAPE_CACHELnet/minecraft/block/Block;FULL_CUBE_SHAPE_CACHE:Lcom/google/common/cache/LoadingCache;intermediary field_19312Lnet/minecraft/class_2248;field_19312:Lcom/google/common/cache/LoadingCache;official cLdno;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_NEIGHBORSLnet/minecraft/block/Block;NOTIFY_NEIGHBORS:Iintermediary field_31027Lnet/minecraft/class_2248;field_31027:Iofficial lLdno;l: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_LISTENERSLnet/minecraft/block/Block;NOTIFY_LISTENERS:Iintermediary field_31028Lnet/minecraft/class_2248;field_31028:Iofficial mLdno;m:I
-
NO_REDRAW
public static final int NO_REDRAWUsed in conjunction withNOTIFY_LISTENERSto suppress the render pass on clients.- See Also:
- Mappings:
Namespace Name Mixin selector named NO_REDRAWLnet/minecraft/block/Block;NO_REDRAW:Iintermediary field_31029Lnet/minecraft/class_2248;field_31029:Iofficial nLdno;n: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_THREADLnet/minecraft/block/Block;REDRAW_ON_MAIN_THREAD:Iintermediary field_31030Lnet/minecraft/class_2248;field_31030:Iofficial oLdno;o: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_STATELnet/minecraft/block/Block;FORCE_STATE:Iintermediary field_31031Lnet/minecraft/class_2248;field_31031:Iofficial pLdno;p: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_DROPSLnet/minecraft/block/Block;SKIP_DROPS:Iintermediary field_31032Lnet/minecraft/class_2248;field_31032:Iofficial qLdno;q: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 MOVEDLnet/minecraft/block/Block;MOVED:Iintermediary field_31033Lnet/minecraft/class_2248;field_31033:Iofficial rLdno;r: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_REPLACEMENTLnet/minecraft/block/Block;SKIP_REDSTONE_WIRE_STATE_REPLACEMENT:Iintermediary field_53822Lnet/minecraft/class_2248;field_53822:Iofficial sLdno;s:I
-
SKIP_BLOCK_ENTITY_REPLACED_CALLBACK
public static final int SKIP_BLOCK_ENTITY_REPLACED_CALLBACKSkipsBlockEntity.onBlockReplaced(net.minecraft.util.math.BlockPos, net.minecraft.block.BlockState). Used when placing structures.- See Also:
- Mappings:
Namespace Name Mixin selector named SKIP_BLOCK_ENTITY_REPLACED_CALLBACKLnet/minecraft/block/Block;SKIP_BLOCK_ENTITY_REPLACED_CALLBACK:Iintermediary field_55739Lnet/minecraft/class_2248;field_55739:Iofficial tLdno;t:I
-
SKIP_BLOCK_ADDED_CALLBACK
public static final int SKIP_BLOCK_ADDED_CALLBACKSkipsAbstractBlock.onBlockAdded(net.minecraft.block.BlockState, net.minecraft.world.World, net.minecraft.util.math.BlockPos, net.minecraft.block.BlockState, boolean). Used when placing structures.- See Also:
- Mappings:
Namespace Name Mixin selector named SKIP_BLOCK_ADDED_CALLBACKLnet/minecraft/block/Block;SKIP_BLOCK_ADDED_CALLBACK:Iintermediary field_56561Lnet/minecraft/class_2248;field_56561:Iofficial uLdno;u:I
-
SKIP_REDRAW_AND_BLOCK_ENTITY_REPLACED_CALLBACK
public static final int SKIP_REDRAW_AND_BLOCK_ENTITY_REPLACED_CALLBACK- See Also:
- Mappings:
Namespace Name Mixin selector named SKIP_REDRAW_AND_BLOCK_ENTITY_REPLACED_CALLBACKLnet/minecraft/block/Block;SKIP_REDRAW_AND_BLOCK_ENTITY_REPLACED_CALLBACK:Iintermediary field_31035Lnet/minecraft/class_2248;field_31035:Iofficial vLdno;v: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_ALLLnet/minecraft/block/Block;NOTIFY_ALL:Iintermediary field_31036Lnet/minecraft/class_2248;field_31036:Iofficial wLdno;w: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_REDRAWLnet/minecraft/block/Block;NOTIFY_ALL_AND_REDRAW:Iintermediary field_31022Lnet/minecraft/class_2248;field_31022:Iofficial xLdno;x:I
-
FORCE_STATE_AND_SKIP_CALLBACKS_AND_DROPS
public static final int FORCE_STATE_AND_SKIP_CALLBACKS_AND_DROPSUsed for 'strict' block placement by commands and structures.- See Also:
- Mappings:
Namespace Name Mixin selector named FORCE_STATE_AND_SKIP_CALLBACKS_AND_DROPSLnet/minecraft/block/Block;FORCE_STATE_AND_SKIP_CALLBACKS_AND_DROPS:Iintermediary field_55740Lnet/minecraft/class_2248;field_55740:Iofficial yLdno;y:I
-
field_31023
public static final float field_31023- See Also:
- Mappings:
Namespace Name Mixin selector named field_31023Lnet/minecraft/block/Block;field_31023:Fintermediary field_31023Lnet/minecraft/class_2248;field_31023:Fofficial zLdno;z:F
-
field_31024
public static final float field_31024- See Also:
- Mappings:
Namespace Name Mixin selector named field_31024Lnet/minecraft/block/Block;field_31024:Fintermediary field_31024Lnet/minecraft/class_2248;field_31024:Fofficial ALdno;A:F
-
field_31025
public static final int field_31025- See Also:
- Mappings:
Namespace Name Mixin selector named field_31025Lnet/minecraft/block/Block;field_31025:Iintermediary field_31025Lnet/minecraft/class_2248;field_31025:Iofficial BLdno;B:I
-
FACE_CULL_MAP_SIZE
private static final int FACE_CULL_MAP_SIZE- See Also:
- Mappings:
Namespace Name Mixin selector named FACE_CULL_MAP_SIZELnet/minecraft/block/Block;FACE_CULL_MAP_SIZE:Iintermediary field_31026Lnet/minecraft/class_2248;field_31026:Iofficial fLdno;f:I
-
FACE_CULL_MAP
- Mappings:
Namespace Name Mixin selector named FACE_CULL_MAPLnet/minecraft/block/Block;FACE_CULL_MAP:Ljava/lang/ThreadLocal;intermediary field_10649Lnet/minecraft/class_2248;field_10649:Ljava/lang/ThreadLocal;official gLdno;g:Ljava/lang/ThreadLocal;
-
registryEntry
- Mappings:
Namespace Name Mixin selector named registryEntryLnet/minecraft/block/Block;registryEntry:Lnet/minecraft/registry/entry/RegistryEntry$Reference;intermediary field_36404Lnet/minecraft/class_2248;field_36404:Lnet/minecraft/class_6880$class_6883;official bLdno;b:Ljg$c;
-
stateManager
- Mappings:
Namespace Name Mixin selector named stateManagerLnet/minecraft/block/Block;stateManager:Lnet/minecraft/state/StateManager;intermediary field_10647Lnet/minecraft/class_2248;field_10647:Lnet/minecraft/class_2689;official CLdno;C:Lebr;
-
defaultState
- Mappings:
Namespace Name Mixin selector named defaultStateLnet/minecraft/block/Block;defaultState:Lnet/minecraft/block/BlockState;intermediary field_10646Lnet/minecraft/class_2248;field_10646:Lnet/minecraft/class_2680;official dLdno;d:Lebq;
-
cachedItem
- Mappings:
Namespace Name Mixin selector named cachedItemLnet/minecraft/block/Block;cachedItem:Lnet/minecraft/item/Item;intermediary field_17562Lnet/minecraft/class_2248;field_17562:Lnet/minecraft/class_1792;official eLdno;e:Ldag;
-
-
Constructor Details
-
Block
- Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/block/AbstractBlock;<init>(Lnet/minecraft/block/AbstractBlock$Settings;)Vintermediary <init>Lnet/minecraft/class_4970;<init>(Lnet/minecraft/class_4970$class_2251;)Vofficial <init>Lebp;<init>(Lebp$d;)V
-
-
Method Details
-
getCodec
- Specified by:
getCodecin classAbstractBlock- Mappings:
Namespace Name Mixin selector named getCodecLnet/minecraft/block/AbstractBlock;getCodec()Lcom/mojang/serialization/MapCodec;intermediary method_53969Lnet/minecraft/class_4970;method_53969()Lcom/mojang/serialization/MapCodec;official aLebp;a()Lcom/mojang/serialization/MapCodec;
-
getRawIdFromState
- Mappings:
Namespace Name Mixin selector named getRawIdFromStateLnet/minecraft/block/Block;getRawIdFromState(Lnet/minecraft/block/BlockState;)Iintermediary method_9507Lnet/minecraft/class_2248;method_9507(Lnet/minecraft/class_2680;)Iofficial jLdno;j(Lebq;)I
-
getStateFromRawId
- Mappings:
Namespace Name Mixin selector named getStateFromRawIdLnet/minecraft/block/Block;getStateFromRawId(I)Lnet/minecraft/block/BlockState;intermediary method_9531Lnet/minecraft/class_2248;method_9531(I)Lnet/minecraft/class_2680;official aLdno;a(I)Lebq;
-
getBlockFromItem
- Mappings:
Namespace Name Mixin selector named getBlockFromItemLnet/minecraft/block/Block;getBlockFromItem(Lnet/minecraft/item/Item;)Lnet/minecraft/block/Block;intermediary method_9503Lnet/minecraft/class_2248;method_9503(Lnet/minecraft/class_1792;)Lnet/minecraft/class_2248;official aLdno;a(Ldag;)Ldno;
-
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 pushEntitiesUpBeforeBlockChangeLnet/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_9582Lnet/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 aLdno;a(Lebq;Lebq;Ldkk;Liw;)Lebq;
-
createCuboidShape
public static VoxelShape createCuboidShape(double minX, double minY, double minZ, double maxX, double maxY, double maxZ) - Mappings:
Namespace Name Mixin selector named createCuboidShapeLnet/minecraft/block/Block;createCuboidShape(DDDDDD)Lnet/minecraft/util/shape/VoxelShape;intermediary method_9541Lnet/minecraft/class_2248;method_9541(DDDDDD)Lnet/minecraft/class_265;official aLdno;a(DDDDDD)Lfgw;
-
createShapeArray
- Mappings:
Namespace Name Mixin selector named createShapeArrayLnet/minecraft/block/Block;createShapeArray(ILjava/util/function/IntFunction;)[Lnet/minecraft/util/shape/VoxelShape;intermediary method_66397Lnet/minecraft/class_2248;method_66397(ILjava/util/function/IntFunction;)[Lnet/minecraft/class_265;official aLdno;a(ILjava/util/function/IntFunction;)[Lfgw;
-
createCubeShape
- Mappings:
Namespace Name Mixin selector named createCubeShapeLnet/minecraft/block/Block;createCubeShape(D)Lnet/minecraft/util/shape/VoxelShape;intermediary method_66393Lnet/minecraft/class_2248;method_66393(D)Lnet/minecraft/class_265;official aLdno;a(D)Lfgw;
-
createCuboidShape
- Mappings:
Namespace Name Mixin selector named createCuboidShapeLnet/minecraft/block/Block;createCuboidShape(DDD)Lnet/minecraft/util/shape/VoxelShape;intermediary method_66394Lnet/minecraft/class_2248;method_66394(DDD)Lnet/minecraft/class_265;official aLdno;a(DDD)Lfgw;
-
createColumnShape
- Mappings:
Namespace Name Mixin selector named createColumnShapeLnet/minecraft/block/Block;createColumnShape(DDD)Lnet/minecraft/util/shape/VoxelShape;intermediary method_66404Lnet/minecraft/class_2248;method_66404(DDD)Lnet/minecraft/class_265;official bLdno;b(DDD)Lfgw;
-
createColumnShape
- Mappings:
Namespace Name Mixin selector named createColumnShapeLnet/minecraft/block/Block;createColumnShape(DDDD)Lnet/minecraft/util/shape/VoxelShape;intermediary method_66395Lnet/minecraft/class_2248;method_66395(DDDD)Lnet/minecraft/class_265;official aLdno;a(DDDD)Lfgw;
-
createCuboidZShape
- Mappings:
Namespace Name Mixin selector named createCuboidZShapeLnet/minecraft/block/Block;createCuboidZShape(DDD)Lnet/minecraft/util/shape/VoxelShape;intermediary method_66408Lnet/minecraft/class_2248;method_66408(DDD)Lnet/minecraft/class_265;official cLdno;c(DDD)Lfgw;
-
createCuboidZShape
- Mappings:
Namespace Name Mixin selector named createCuboidZShapeLnet/minecraft/block/Block;createCuboidZShape(DDDD)Lnet/minecraft/util/shape/VoxelShape;intermediary method_66405Lnet/minecraft/class_2248;method_66405(DDDD)Lnet/minecraft/class_265;official bLdno;b(DDDD)Lfgw;
-
createCuboidZShape
public static VoxelShape createCuboidZShape(double sizeX, double minY, double maxY, double minZ, double maxZ) - Mappings:
Namespace Name Mixin selector named createCuboidZShapeLnet/minecraft/block/Block;createCuboidZShape(DDDDD)Lnet/minecraft/util/shape/VoxelShape;intermediary method_66396Lnet/minecraft/class_2248;method_66396(DDDDD)Lnet/minecraft/class_265;official aLdno;a(DDDDD)Lfgw;
-
postProcessState
- Mappings:
Namespace Name Mixin selector named postProcessStateLnet/minecraft/block/Block;postProcessState(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/block/BlockState;intermediary method_9510Lnet/minecraft/class_2248;method_9510(Lnet/minecraft/class_2680;Lnet/minecraft/class_1936;Lnet/minecraft/class_2338;)Lnet/minecraft/class_2680;official bLdno;b(Lebq;Ldkk;Liw;)Lebq;
-
replace
public static void replace(BlockState state, BlockState newState, WorldAccess world, BlockPos pos, int flags) Replaces thestatewith thenewStateat 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 replaceLnet/minecraft/block/Block;replace(Lnet/minecraft/block/BlockState;Lnet/minecraft/block/BlockState;Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;I)Vintermediary method_30094Lnet/minecraft/class_2248;method_30094(Lnet/minecraft/class_2680;Lnet/minecraft/class_2680;Lnet/minecraft/class_1936;Lnet/minecraft/class_2338;I)Vofficial aLdno;a(Lebq;Lebq;Ldkk;Liw;I)V
-
replace
public static void replace(BlockState state, BlockState newState, WorldAccess world, BlockPos pos, int flags, int maxUpdateDepth) Replaces thestatewith thenewStateat 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 replaceLnet/minecraft/block/Block;replace(Lnet/minecraft/block/BlockState;Lnet/minecraft/block/BlockState;Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;II)Vintermediary method_9611Lnet/minecraft/class_2248;method_9611(Lnet/minecraft/class_2680;Lnet/minecraft/class_2680;Lnet/minecraft/class_1936;Lnet/minecraft/class_2338;II)Vofficial aLdno;a(Lebq;Lebq;Ldkk;Liw;II)V
-
cannotConnect
- Mappings:
Namespace Name Mixin selector named cannotConnectLnet/minecraft/block/Block;cannotConnect(Lnet/minecraft/block/BlockState;)Zintermediary method_9581Lnet/minecraft/class_2248;method_9581(Lnet/minecraft/class_2680;)Zofficial kLdno;k(Lebq;)Z
-
shouldDrawSide
- Mappings:
Namespace Name Mixin selector named shouldDrawSideLnet/minecraft/block/Block;shouldDrawSide(Lnet/minecraft/block/BlockState;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/Direction;)Zintermediary method_9607Lnet/minecraft/class_2248;method_9607(Lnet/minecraft/class_2680;Lnet/minecraft/class_2680;Lnet/minecraft/class_2350;)Zofficial aLdno;a(Lebq;Lebq;Ljc;)Z
-
hasTopRim
- Mappings:
Namespace Name Mixin selector named hasTopRimLnet/minecraft/block/Block;hasTopRim(Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;)Zintermediary method_16361Lnet/minecraft/class_2248;method_16361(Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;)Zofficial cLdno;c(Ldjn;Liw;)Z
-
sideCoversSmallSquare
- Mappings:
Namespace Name Mixin selector named sideCoversSmallSquareLnet/minecraft/block/Block;sideCoversSmallSquare(Lnet/minecraft/world/WorldView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;)Zintermediary method_20044Lnet/minecraft/class_2248;method_20044(Lnet/minecraft/class_4538;Lnet/minecraft/class_2338;Lnet/minecraft/class_2350;)Zofficial aLdno;a(Ldkm;Liw;Ljc;)Z
-
isFaceFullSquare
- Mappings:
Namespace Name Mixin selector named isFaceFullSquareLnet/minecraft/block/Block;isFaceFullSquare(Lnet/minecraft/util/shape/VoxelShape;Lnet/minecraft/util/math/Direction;)Zintermediary method_9501Lnet/minecraft/class_2248;method_9501(Lnet/minecraft/class_265;Lnet/minecraft/class_2350;)Zofficial aLdno;a(Lfgw;Ljc;)Z
-
isShapeFullCube
- Mappings:
Namespace Name Mixin selector named isShapeFullCubeLnet/minecraft/block/Block;isShapeFullCube(Lnet/minecraft/util/shape/VoxelShape;)Zintermediary method_9614Lnet/minecraft/class_2248;method_9614(Lnet/minecraft/class_265;)Zofficial aLdno;a(Lfgw;)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 randomDisplayTickLnet/minecraft/block/Block;randomDisplayTick(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/random/Random;)Vintermediary method_9496Lnet/minecraft/class_2248;method_9496(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_5819;)Vofficial aLdno;a(Lebq;Ldkj;Liw;Lbai;)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.server.world.ServerWorld, net.minecraft.util.math.BlockPos, 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 onBrokenLnet/minecraft/block/Block;onBroken(Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Vintermediary method_9585Lnet/minecraft/class_2248;method_9585(Lnet/minecraft/class_1936;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Vofficial aLdno;a(Ldkk;Liw;Lebq;)V
-
getDroppedStacks
public static List<ItemStack> getDroppedStacks(BlockState state, ServerWorld world, BlockPos pos, @Nullable @Nullable BlockEntity blockEntity) - Mappings:
Namespace Name Mixin selector named getDroppedStacksLnet/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_9562Lnet/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 aLdno;a(Lebq;Lasb;Liw;Ldyo;)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 getDroppedStacksLnet/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_9609Lnet/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 aLdno;a(Lebq;Lasb;Liw;Ldyo;Lbxe;Ldak;)Ljava/util/List;
-
dropStacks
- Mappings:
Namespace Name Mixin selector named dropStacksLnet/minecraft/block/Block;dropStacks(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)Vintermediary method_9497Lnet/minecraft/class_2248;method_9497(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;)Vofficial cLdno;c(Lebq;Ldkj;Liw;)V
-
dropStacks
public static void dropStacks(BlockState state, WorldAccess world, BlockPos pos, @Nullable @Nullable BlockEntity blockEntity) - Mappings:
Namespace Name Mixin selector named dropStacksLnet/minecraft/block/Block;dropStacks(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/entity/BlockEntity;)Vintermediary method_9610Lnet/minecraft/class_2248;method_9610(Lnet/minecraft/class_2680;Lnet/minecraft/class_1936;Lnet/minecraft/class_2338;Lnet/minecraft/class_2586;)Vofficial aLdno;a(Lebq;Ldkk;Liw;Ldyo;)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 dropStacksLnet/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;)Vintermediary method_9511Lnet/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;)Vofficial aLdno;a(Lebq;Ldkj;Liw;Ldyo;Lbxe;Ldak;)V
-
dropStack
- Mappings:
Namespace Name Mixin selector named dropStackLnet/minecraft/block/Block;dropStack(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/item/ItemStack;)Vintermediary method_9577Lnet/minecraft/class_2248;method_9577(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1799;)Vofficial aLdno;a(Ldkj;Liw;Ldak;)V
-
dropStack
- Mappings:
Namespace Name Mixin selector named dropStackLnet/minecraft/block/Block;dropStack(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;Lnet/minecraft/item/ItemStack;)Vintermediary method_36992Lnet/minecraft/class_2248;method_36992(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2350;Lnet/minecraft/class_1799;)Vofficial aLdno;a(Ldkj;Liw;Ljc;Ldak;)V
-
dropStack
private static void dropStack(World world, Supplier<ItemEntity> itemEntitySupplier, ItemStack stack) - Mappings:
Namespace Name Mixin selector named dropStackLnet/minecraft/block/Block;dropStack(Lnet/minecraft/world/World;Ljava/util/function/Supplier;Lnet/minecraft/item/ItemStack;)Vintermediary method_36993Lnet/minecraft/class_2248;method_36993(Lnet/minecraft/class_1937;Ljava/util/function/Supplier;Lnet/minecraft/class_1799;)Vofficial aLdno;a(Ldkj;Ljava/util/function/Supplier;Ldak;)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)afterdropExperiencecheck. This does not drop experience orbs ifdoTileDropsis 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 dropExperienceLnet/minecraft/block/Block;dropExperience(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/math/BlockPos;I)Vintermediary method_9583Lnet/minecraft/class_2248;method_9583(Lnet/minecraft/class_3218;Lnet/minecraft/class_2338;I)Vofficial aLdno;a(Lasb;Liw;I)V
-
getBlastResistance
public float getBlastResistance()- Mappings:
Namespace Name Mixin selector named getBlastResistanceLnet/minecraft/block/Block;getBlastResistance()Fintermediary method_9520Lnet/minecraft/class_2248;method_9520()Fofficial eLdno;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 onDestroyedByExplosionLnet/minecraft/block/Block;onDestroyedByExplosion(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/world/explosion/Explosion;)Vintermediary method_9586Lnet/minecraft/class_2248;method_9586(Lnet/minecraft/class_3218;Lnet/minecraft/class_2338;Lnet/minecraft/class_1927;)Vofficial aLdno;a(Lasb;Liw;Ldkc;)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 onSteppedOnLnet/minecraft/block/Block;onSteppedOn(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/entity/Entity;)Vintermediary method_9591Lnet/minecraft/class_2248;method_9591(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Lnet/minecraft/class_1297;)Vofficial aLdno;a(Ldkj;Liw;Lebq;Lbxe;)V
-
getPlacementState
- Mappings:
Namespace Name Mixin selector named getPlacementStateLnet/minecraft/block/Block;getPlacementState(Lnet/minecraft/item/ItemPlacementContext;)Lnet/minecraft/block/BlockState;intermediary method_9605Lnet/minecraft/class_2248;method_9605(Lnet/minecraft/class_1750;)Lnet/minecraft/class_2680;official aLdno;a(Lded;)Lebq;
-
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).BeehiveBlockuses this to anger the bees if the hive is mined without silk touch.- See Also:
- Mappings:
Namespace Name Mixin selector named afterBreakLnet/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;)Vintermediary method_9556Lnet/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;)Vofficial aLdno;a(Ldkj;Lcsi;Liw;Lebq;Ldyo;Ldak;)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 onPlacedLnet/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;)Vintermediary method_9567Lnet/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;)Vofficial aLdno;a(Ldkj;Liw;Lebq;Lbyf;Ldak;)V
-
canMobSpawnInside
- Mappings:
Namespace Name Mixin selector named canMobSpawnInsideLnet/minecraft/block/Block;canMobSpawnInside(Lnet/minecraft/block/BlockState;)Zintermediary method_9538Lnet/minecraft/class_2248;method_9538(Lnet/minecraft/class_2680;)Zofficial aLdno;a(Lebq;)Z
-
getName
- Mappings:
Namespace Name Mixin selector named getNameLnet/minecraft/block/Block;getName()Lnet/minecraft/text/MutableText;intermediary method_9518Lnet/minecraft/class_2248;method_9518()Lnet/minecraft/class_5250;official fLdno;f()Lxu;
-
onLandedUpon
public void onLandedUpon(World world, BlockState state, BlockPos pos, Entity entity, double 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.FarmlandBlockoverrides 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 onLandedUponLnet/minecraft/block/Block;onLandedUpon(Lnet/minecraft/world/World;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/Entity;D)Vintermediary method_9554Lnet/minecraft/class_2248;method_9554(Lnet/minecraft/class_1937;Lnet/minecraft/class_2680;Lnet/minecraft/class_2338;Lnet/minecraft/class_1297;D)Vofficial aLdno;a(Ldkj;Lebq;Liw;Lbxe;D)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 onEntityLandLnet/minecraft/block/Block;onEntityLand(Lnet/minecraft/world/BlockView;Lnet/minecraft/entity/Entity;)Vintermediary method_9502Lnet/minecraft/class_2248;method_9502(Lnet/minecraft/class_1922;Lnet/minecraft/class_1297;)Vofficial aLdno;a(Ldjn;Lbxe;)V
-
getSlipperiness
public float getSlipperiness()- Mappings:
Namespace Name Mixin selector named getSlipperinessLnet/minecraft/block/Block;getSlipperiness()Fintermediary method_9499Lnet/minecraft/class_2248;method_9499()Fofficial gLdno;g()F
-
getVelocityMultiplier
public float getVelocityMultiplier()- Mappings:
Namespace Name Mixin selector named getVelocityMultiplierLnet/minecraft/block/Block;getVelocityMultiplier()Fintermediary method_23349Lnet/minecraft/class_2248;method_23349()Fofficial iLdno;i()F
-
getJumpVelocityMultiplier
public float getJumpVelocityMultiplier()- Mappings:
Namespace Name Mixin selector named getJumpVelocityMultiplierLnet/minecraft/block/Block;getJumpVelocityMultiplier()Fintermediary method_23350Lnet/minecraft/class_2248;method_23350()Fofficial jLdno;j()F
-
spawnBreakParticles
protected void spawnBreakParticles(World world, PlayerEntity player, BlockPos pos, BlockState state) - Mappings:
Namespace Name Mixin selector named spawnBreakParticlesLnet/minecraft/block/Block;spawnBreakParticles(Lnet/minecraft/world/World;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Vintermediary method_33614Lnet/minecraft/class_2248;method_33614(Lnet/minecraft/class_1937;Lnet/minecraft/class_1657;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Vofficial aLdno;a(Ldkj;Lcsi;Liw;Lebq;)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.server.world.ServerWorld, net.minecraft.util.math.BlockPos, 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 onBreakLnet/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_9576Lnet/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 aLdno;a(Ldkj;Liw;Lebq;Lcsi;)Lebq;
-
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 therandomTickSpeedgame rule, andAbstractBlock.Settings.ticksRandomly()block setting is not required.LeveledCauldronBlockuses this to fill the cauldron.- Parameters:
precipitation- the precipitation (snow or rain), including snow observable on high altitude- Mappings:
Namespace Name Mixin selector named precipitationTickLnet/minecraft/block/Block;precipitationTick(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/world/biome/Biome$Precipitation;)Vintermediary method_9504Lnet/minecraft/class_2248;method_9504(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1959$class_1963;)Vofficial aLdno;a(Lebq;Ldkj;Liw;Ldlm$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
TntBlockthat 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 shouldDropItemsOnExplosionLnet/minecraft/block/Block;shouldDropItemsOnExplosion(Lnet/minecraft/world/explosion/Explosion;)Zintermediary method_9533Lnet/minecraft/class_2248;method_9533(Lnet/minecraft/class_1927;)Zofficial aLdno;a(Ldkc;)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. SeePropertiesfor the list of pre-defined properties.- Mappings:
Namespace Name Mixin selector named appendPropertiesLnet/minecraft/block/Block;appendProperties(Lnet/minecraft/state/StateManager$Builder;)Vintermediary method_9515Lnet/minecraft/class_2248;method_9515(Lnet/minecraft/class_2689$class_2690;)Vofficial aLdno;a(Lebr$a;)V
-
getStateManager
- Mappings:
Namespace Name Mixin selector named getStateManagerLnet/minecraft/block/Block;getStateManager()Lnet/minecraft/state/StateManager;intermediary method_9595Lnet/minecraft/class_2248;method_9595()Lnet/minecraft/class_2689;official lLdno;l()Lebr;
-
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 setDefaultStateLnet/minecraft/block/Block;setDefaultState(Lnet/minecraft/block/BlockState;)Vintermediary method_9590Lnet/minecraft/class_2248;method_9590(Lnet/minecraft/class_2680;)Vofficial lLdno;l(Lebq;)V
-
getDefaultState
- Mappings:
Namespace Name Mixin selector named getDefaultStateLnet/minecraft/block/Block;getDefaultState()Lnet/minecraft/block/BlockState;intermediary method_9564Lnet/minecraft/class_2248;method_9564()Lnet/minecraft/class_2680;official mLdno;m()Lebq;
-
getStateWithProperties
Gets a block state with all properties that both this block and the source block state have.- Mappings:
Namespace Name Mixin selector named getStateWithPropertiesLnet/minecraft/block/Block;getStateWithProperties(Lnet/minecraft/block/BlockState;)Lnet/minecraft/block/BlockState;intermediary method_34725Lnet/minecraft/class_2248;method_34725(Lnet/minecraft/class_2680;)Lnet/minecraft/class_2680;official mLdno;m(Lebq;)Lebq;
-
copyProperty
private static <T extends Comparable<T>> BlockState copyProperty(BlockState source, BlockState target, Property<T> property) - Mappings:
Namespace Name Mixin selector named copyPropertyLnet/minecraft/block/Block;copyProperty(Lnet/minecraft/block/BlockState;Lnet/minecraft/block/BlockState;Lnet/minecraft/state/property/Property;)Lnet/minecraft/block/BlockState;intermediary method_34724Lnet/minecraft/class_2248;method_34724(Lnet/minecraft/class_2680;Lnet/minecraft/class_2680;Lnet/minecraft/class_2769;)Lnet/minecraft/class_2680;official aLdno;a(Lebq;Lebq;Lect;)Lebq;
-
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:
asItemin interfaceItemConvertible- Specified by:
asItemin classAbstractBlock- Returns:
- the block's corresponding item
- See Also:
- Mappings:
Namespace Name Mixin selector named asItemLnet/minecraft/block/AbstractBlock;asItem()Lnet/minecraft/item/Item;intermediary method_8389Lnet/minecraft/class_4970;method_8389()Lnet/minecraft/class_1792;official hLebp;h()Ldag;
-
hasDynamicBounds
public boolean hasDynamicBounds()- Mappings:
Namespace Name Mixin selector named hasDynamicBoundsLnet/minecraft/block/Block;hasDynamicBounds()Zintermediary method_9543Lnet/minecraft/class_2248;method_9543()Zofficial nLdno;n()Z
-
toString
-
asBlock
Returns the block asBlock.This is used for casting purposes.
- Specified by:
asBlockin classAbstractBlock- Returns:
- the block as
Block - Mappings:
Namespace Name Mixin selector named asBlockLnet/minecraft/block/AbstractBlock;asBlock()Lnet/minecraft/block/Block;intermediary method_26160Lnet/minecraft/class_4970;method_26160()Lnet/minecraft/class_2248;official oLebp;o()Ldno;
-
createShapeFunction
protected Function<BlockState,VoxelShape> createShapeFunction(Function<BlockState, VoxelShape> stateToShape) - Mappings:
Namespace Name Mixin selector named createShapeFunctionLnet/minecraft/block/Block;createShapeFunction(Ljava/util/function/Function;)Ljava/util/function/Function;intermediary method_33615Lnet/minecraft/class_2248;method_33615(Ljava/util/function/Function;)Ljava/util/function/Function;official aLdno;a(Ljava/util/function/Function;)Ljava/util/function/Function;
-
createShapeFunction
protected Function<BlockState,VoxelShape> createShapeFunction(Function<BlockState, VoxelShape> stateToShape, Property<?>[] properties) - Mappings:
Namespace Name Mixin selector named createShapeFunctionLnet/minecraft/block/Block;createShapeFunction(Ljava/util/function/Function;[Lnet/minecraft/state/property/Property;)Ljava/util/function/Function;intermediary method_66403Lnet/minecraft/class_2248;method_66403(Ljava/util/function/Function;[Lnet/minecraft/class_2769;)Ljava/util/function/Function;official aLdno;a(Ljava/util/function/Function;[Lect;)Ljava/util/function/Function;
-
applyValueToState
private static <S extends State<?,S>, S applyValueToStateT extends Comparable<T>> (S state, Property<T> property, Object value) - Mappings:
Namespace Name Mixin selector named applyValueToStateLnet/minecraft/block/Block;applyValueToState(Lnet/minecraft/state/State;Lnet/minecraft/state/property/Property;Ljava/lang/Object;)Lnet/minecraft/state/State;intermediary method_66399Lnet/minecraft/class_2248;method_66399(Lnet/minecraft/class_2688;Lnet/minecraft/class_2769;Ljava/lang/Object;)Lnet/minecraft/class_2688;official aLdno;a(Lebs;Lect;Ljava/lang/Object;)Lebs;
-
getRegistryEntry
Deprecated.- Mappings:
Namespace Name Mixin selector named getRegistryEntryLnet/minecraft/block/Block;getRegistryEntry()Lnet/minecraft/registry/entry/RegistryEntry$Reference;intermediary method_40142Lnet/minecraft/class_2248;method_40142()Lnet/minecraft/class_6880$class_6883;official pLdno;p()Ljg$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)afterdropExperiencecheck. This does not drop experience orbs iftoolis enchanted with silk touch or ifdoTileDropsis turned off.- Parameters:
tool- the tool used to break the block, orItemStack.EMPTYfor explosions- See Also:
- Mappings:
Namespace Name Mixin selector named dropExperienceWhenMinedLnet/minecraft/block/Block;dropExperienceWhenMined(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/item/ItemStack;Lnet/minecraft/util/math/intprovider/IntProvider;)Vintermediary method_41420Lnet/minecraft/class_2248;method_41420(Lnet/minecraft/class_3218;Lnet/minecraft/class_2338;Lnet/minecraft/class_1799;Lnet/minecraft/class_6017;)Vofficial aLdno;a(Lasb;Liw;Ldak;Lbuh;)V
-