Class AbstractBlock
- All Implemented Interfaces:
ToggleableFeature
- Direct Known Subclasses:
Block
blocks.
This class should not be extended directly. Extend Block instead.
Custom block behaviors are specified either through block settings or by overriding methods in this class.
Methods in this class may be executed during world generation if they take
WorldAccess as a parameter. In this case, a ChunkRegion
is passed to the parameter, which is not a subclass of World.
Deprecated methods in this class mean they
should only be called from the corresponding method in AbstractBlock.AbstractBlockState or subclasses of this class. Overriding the
methods is an expected usage and is not deprecated in any way.
- API Note:
- In vanilla subclasses, these methods are called either to do the
default behavior (e.g.
super.onUse(...)) or to delegate logic to other blocks (e.g.StairsBlock#randomTickcallsrandomTickof its base block).Many methods of this class are called on both the logical client and logical server, so take caution when using those methods. The logical side can be checked using
World.isClient.Quick view
Notes: "Tall or wide block" refers to a block that has multiple parts, such as doors, sunflowers, or beds. "Neighboring block" refers to blocks adjacent to a block on all 6 sides (but not diagonally.)
Placement related methods
Block placement related methods (sorted by execution order) Method Purpose Player/dispenser Falling block setBlockStatecalloldState. canReplaceChecking if the current block can be replaced Yes Yes No newBlock. getPlacementStateGetting the placed state Yes Yes No newState. canPlaceAtChecking the block's placement restriction Yes Yes No oldState. onStateReplacedDropping inventory, updating redstone circuit, etc Yes Yes Yes newState. onBlockAddedActivating redstone component, etc Yes Yes Yes neighborState. neighborUpdateActivating neighboring redstone component, etc Yes Yes Yes oldState. prepareUpdating redstone wire connection Yes Yes Yes neighborState. getStateForNeighborUpdateChecking the neighboring block's placement restriction, updating connection, etc Yes Yes Yes newState. prepareUpdating redstone wire connection Yes Yes Yes newBlock. onPlacedPlacing the other half of tall or wide block, setting block entity's custom name, etc Yes No No Breaking related methods
Block breaking related methods (sorted by execution order) Method Purpose Player mining Explosion setBlockState/removeBlockcallbreakBlockcallstate. onBlockBreakStartDoing something when player starts breaking a block Yes No No No state. calcBlockBreakingDeltaCalculating the player's mining speed Yes No No No block. onBreakSpawning particles, breaking the other half of tall or wide block, etc Yes No No No state. onStateReplacedDropping inventory, updating redstone circuit, etc Yes Yes Yes Yes neighborState. neighborUpdateActivating neighboring redstone component, etc Yes Yes Yes Yes state. prepareUpdating redstone wire connection Yes Yes Yes Yes neighborState. getStateForNeighborUpdateChecking the neighboring block's placement restriction, updating connection, etc Yes Yes Yes Yes block. onBrokenUnused in most cases Yes No No No block. afterBreakDropping stacks, replacing the broken block with another block, etc Yes No No No state. getDroppedStacksSupplying information to loot context builder Yes Yes Yes Yes1 state. onStacksDroppedDropping experience orbs Yes Yes2 Yes Yes1 Notes:
- Called before
onStateReplacedin this case. - Called before
getDroppedStacksin this case.
- Called before
- Mappings:
Namespace Name official dbxintermediary net/minecraft/class_4970named net/minecraft/block/AbstractBlock
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic interfacestatic interfacestatic enumstatic classstatic interface -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final booleanprotected static final Direction[]protected final booleanprotected final floatprotected @Nullable Identifierprotected final booleanprotected final FeatureSetprotected final floatprotected final AbstractBlock.Settingsprotected final floatprotected final BlockSoundGroupprotected final floatFields inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeature
FEATURE_ENABLED_REGISTRY_KEYS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract BlockasBlock()Returns the block asBlock.abstract ItemasItem()Returns the block's corresponding item.floatcalcBlockBreakingDelta(BlockState state, PlayerEntity player, BlockView world, BlockPos pos) Deprecated.booleancanBucketPlace(BlockState state, Fluid fluid) Deprecated.Consider callingAbstractBlock.AbstractBlockState.canBucketPlace(net.minecraft.fluid.Fluid)instead.booleancanPathfindThrough(BlockState state, BlockView world, BlockPos pos, NavigationType type) booleancanPlaceAt(BlockState state, WorldView world, BlockPos pos) Deprecated.booleancanReplace(BlockState state, ItemPlacementContext context) Deprecated.Consider callingAbstractBlock.AbstractBlockState.canReplace(net.minecraft.item.ItemPlacementContext)instead.createScreenHandlerFactory(BlockState state, World world, BlockPos pos) Deprecated.booleanemitsRedstonePower(BlockState state) Deprecated.Consider callingAbstractBlock.AbstractBlockState.emitsRedstonePower()instead.floatgetAmbientOcclusionLightLevel(BlockState state, BlockView world, BlockPos pos) Deprecated.getCameraCollisionShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) getCollisionShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) Deprecated.Consider callingAbstractBlock.AbstractBlockState.getCollisionShape(BlockView, BlockPos, ShapeContext)instead.intgetComparatorOutput(BlockState state, World world, BlockPos pos) Deprecated.getCullingShape(BlockState state, BlockView world, BlockPos pos) Deprecated.getDroppedStacks(BlockState state, class_8567.class_8568 builder) Deprecated.Consider callingAbstractBlock.AbstractBlockState.getDroppedStacks(net.minecraft.class_8567.class_8568)instead.getFluidState(BlockState state) Deprecated.Consider callingAbstractBlock.AbstractBlockState.getFluidState()instead.floatfinal IdentifierfloatintgetOpacity(BlockState state, BlockView world, BlockPos pos) Deprecated.getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) Deprecated.Consider callingAbstractBlock.AbstractBlockState.getOutlineShape(BlockView, BlockPos, ShapeContext)instead.getRaycastShape(BlockState state, BlockView world, BlockPos pos) Deprecated.longgetRenderingSeed(BlockState state, BlockPos pos) Deprecated.Consider callingAbstractBlock.AbstractBlockState.getRenderingSeed(net.minecraft.util.math.BlockPos)instead.getRenderType(BlockState state) Deprecated.Consider callingAbstractBlock.AbstractBlockState.getRenderType()instead.getSidesShape(BlockState state, BlockView world, BlockPos pos) Deprecated.getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) intgetStrongRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction) floatintgetWeakRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction) booleanhasComparatorOutput(BlockState state) Deprecated.Consider callingAbstractBlock.AbstractBlockState.hasComparatorOutput()instead.booleanhasSidedTransparency(BlockState state) Deprecated.Consider callingAbstractBlock.AbstractBlockState.hasSidedTransparencyinstead.booleanisCullingShapeFullCube(BlockState state, BlockView world, BlockPos pos) Deprecated.booleanisShapeFullCube(BlockState state, BlockView world, BlockPos pos) Deprecated.booleanisSideInvisible(BlockState state, BlockState stateFrom, Direction direction) Deprecated.mirror(BlockState state, BlockMirror mirror) Deprecated.Consider callingAbstractBlock.AbstractBlockState.mirror(net.minecraft.util.BlockMirror)instead.voidneighborUpdate(BlockState state, World world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) voidonBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean notify) Deprecated.voidonBlockBreakStart(BlockState state, World world, BlockPos pos, PlayerEntity player) voidonEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) Deprecated.voidonProjectileHit(World world, BlockState state, BlockHitResult hit, ProjectileEntity projectile) voidonStacksDropped(BlockState state, ServerWorld world, BlockPos pos, ItemStack tool, boolean dropExperience) voidonStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) Deprecated.booleanonSyncedBlockEvent(BlockState state, World world, BlockPos pos, int type, int data) Deprecated.onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) voidprepare(BlockState state, WorldAccess world, BlockPos pos, int flags, int maxUpdateDepth) Deprecated.Consider callingAbstractBlock.AbstractBlockState.prepare(WorldAccess, BlockPos, int, int)instead.voidrandomTick(BlockState state, ServerWorld world, BlockPos pos, Random random) rotate(BlockState state, BlockRotation rotation) Deprecated.Consider callingAbstractBlock.AbstractBlockState.rotate(net.minecraft.util.BlockRotation)instead.voidscheduledTick(BlockState state, ServerWorld world, BlockPos pos, Random random) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeature
isEnabled
-
Field Details
-
DIRECTIONS
- Mappings:
Namespace Name Mixin selector official aDLdbx;aD:[Lha;intermediary field_23157Lnet/minecraft/class_4970;field_23157:[Lnet/minecraft/class_2350;named DIRECTIONSLnet/minecraft/block/AbstractBlock;DIRECTIONS:[Lnet/minecraft/util/math/Direction;
-
collidable
protected final boolean collidable- Mappings:
Namespace Name Mixin selector official aELdbx;aE:Zintermediary field_23159Lnet/minecraft/class_4970;field_23159:Znamed collidableLnet/minecraft/block/AbstractBlock;collidable:Z
-
resistance
protected final float resistance- Mappings:
Namespace Name Mixin selector official aFLdbx;aF:Fintermediary field_23160Lnet/minecraft/class_4970;field_23160:Fnamed resistanceLnet/minecraft/block/AbstractBlock;resistance:F
-
randomTicks
protected final boolean randomTicks- Mappings:
Namespace Name Mixin selector official aGLdbx;aG:Zintermediary field_23161Lnet/minecraft/class_4970;field_23161:Znamed randomTicksLnet/minecraft/block/AbstractBlock;randomTicks:Z
-
soundGroup
- Mappings:
Namespace Name Mixin selector official aHLdbx;aH:Lcwx;intermediary field_23162Lnet/minecraft/class_4970;field_23162:Lnet/minecraft/class_2498;named soundGroupLnet/minecraft/block/AbstractBlock;soundGroup:Lnet/minecraft/sound/BlockSoundGroup;
-
slipperiness
protected final float slipperiness- Mappings:
Namespace Name Mixin selector official aILdbx;aI:Fintermediary field_23163Lnet/minecraft/class_4970;field_23163:Fnamed slipperinessLnet/minecraft/block/AbstractBlock;slipperiness:F
-
velocityMultiplier
protected final float velocityMultiplier- Mappings:
Namespace Name Mixin selector official aJLdbx;aJ:Fintermediary field_23164Lnet/minecraft/class_4970;field_23164:Fnamed velocityMultiplierLnet/minecraft/block/AbstractBlock;velocityMultiplier:F
-
jumpVelocityMultiplier
protected final float jumpVelocityMultiplier- Mappings:
Namespace Name Mixin selector official aKLdbx;aK:Fintermediary field_23165Lnet/minecraft/class_4970;field_23165:Fnamed jumpVelocityMultiplierLnet/minecraft/block/AbstractBlock;jumpVelocityMultiplier:F
-
dynamicBounds
protected final boolean dynamicBounds- Mappings:
Namespace Name Mixin selector official aLLdbx;aL:Zintermediary field_23154Lnet/minecraft/class_4970;field_23154:Znamed dynamicBoundsLnet/minecraft/block/AbstractBlock;dynamicBounds:Z
-
requiredFeatures
- Mappings:
Namespace Name Mixin selector official aMLdbx;aM:Lcau;intermediary field_40337Lnet/minecraft/class_4970;field_40337:Lnet/minecraft/class_7699;named requiredFeaturesLnet/minecraft/block/AbstractBlock;requiredFeatures:Lnet/minecraft/resource/featuretoggle/FeatureSet;
-
settings
- Mappings:
Namespace Name Mixin selector official aNLdbx;aN:Ldbx$d;intermediary field_23155Lnet/minecraft/class_4970;field_23155:Lnet/minecraft/class_4970$class_2251;named settingsLnet/minecraft/block/AbstractBlock;settings:Lnet/minecraft/block/AbstractBlock$Settings;
-
lootTableId
- Mappings:
Namespace Name Mixin selector official aOLdbx;aO:Lacq;intermediary field_23156Lnet/minecraft/class_4970;field_23156:Lnet/minecraft/class_2960;named lootTableIdLnet/minecraft/block/AbstractBlock;lootTableId:Lnet/minecraft/util/Identifier;
-
-
Constructor Details
-
AbstractBlock
- Mappings:
Namespace Name Mixin selector official <init>Ldbx;<init>(Ldbx$d;)Vintermediary <init>Lnet/minecraft/class_4970;<init>(Lnet/minecraft/class_4970$class_2251;)Vnamed <init>Lnet/minecraft/block/AbstractBlock;<init>(Lnet/minecraft/block/AbstractBlock$Settings;)V
-
-
Method Details
-
prepare
@Deprecated public void prepare(BlockState state, WorldAccess world, BlockPos pos, int flags, int maxUpdateDepth) Deprecated.Consider callingAbstractBlock.AbstractBlockState.prepare(WorldAccess, BlockPos, int, int)instead. See why these methods are deprecated.Called when the block state changes, before the neighbor-triggered state update on the original block, and after the neighbor-triggered state update on the replaced 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.- See Also:
- API Note:
- This is used by
RedstoneWireBlockto update connected redstone wire. - Mappings:
Namespace Name Mixin selector official aLdbx;a(Ldby;Lcml;Lgu;II)Vintermediary method_9517Lnet/minecraft/class_4970;method_9517(Lnet/minecraft/class_2680;Lnet/minecraft/class_1936;Lnet/minecraft/class_2338;II)Vnamed prepareLnet/minecraft/block/AbstractBlock;prepare(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;II)V
-
getStateForNeighborUpdate
@Deprecated public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) Deprecated.Returns the state of the block after a neighboring block's state change.Returning
Blocks.AIRbreaks the block. This is useful to implement supporting block requirement for blocks (if used along withcanPlaceAt(net.minecraft.block.BlockState, net.minecraft.world.WorldView, net.minecraft.util.math.BlockPos)).Side effects like activating a redstone component (but not scheduling a tick) should be performed in
neighborUpdate(net.minecraft.block.BlockState, net.minecraft.world.World, net.minecraft.util.math.BlockPos, net.minecraft.block.Block, net.minecraft.util.math.BlockPos, boolean)instead. If the block supports waterlogging and currently has water, this method should be overridden to tick the fluid at the block's position.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. This is not called ifBlock.FORCE_STATEflag is set in thesetBlockStatecall.This method can be used for multiple purposes. Here are some examples:
FenceBlockuses it to update the fence's connection when a horizontally neighboring block's state is changed.PlantBlockuses it to break the plant if the state change causes it to lose its supporting block.DoorBlockuses it to copy the state of the other half of the door.SlabBlockuses it to schedule the fluid to tick if waterlogged.SoulSandBlockuses it to schedule the water block above to tick so that it becomes a bubble column.FallingBlockuses it to schedule the block to tick so that it can fall if needed.
- Parameters:
state- the state of this blockdirection- the direction from this block to the neighborneighborState- the state of the updated neighbor blockworld- the worldpos- the position of this blockneighborPos- the position of the neighbor block- Returns:
- the state of the block after a neighboring block's state change
- See Also:
- Mappings:
Namespace Name Mixin selector official aLdbx;a(Ldby;Lha;Ldby;Lcml;Lgu;Lgu;)Ldby;intermediary method_9559Lnet/minecraft/class_4970;method_9559(Lnet/minecraft/class_2680;Lnet/minecraft/class_2350;Lnet/minecraft/class_2680;Lnet/minecraft/class_1936;Lnet/minecraft/class_2338;Lnet/minecraft/class_2338;)Lnet/minecraft/class_2680;named getStateForNeighborUpdateLnet/minecraft/block/AbstractBlock;getStateForNeighborUpdate(Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/Direction;Lnet/minecraft/block/BlockState;Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/block/BlockState;
-
isSideInvisible
@Deprecated public boolean isSideInvisible(BlockState state, BlockState stateFrom, Direction direction) Deprecated.- Mappings:
Namespace Name Mixin selector official aLdbx;a(Ldby;Ldby;Lha;)Zintermediary method_9522Lnet/minecraft/class_4970;method_9522(Lnet/minecraft/class_2680;Lnet/minecraft/class_2680;Lnet/minecraft/class_2350;)Znamed isSideInvisibleLnet/minecraft/block/AbstractBlock;isSideInvisible(Lnet/minecraft/block/BlockState;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/Direction;)Z
-
neighborUpdate
@Deprecated public void neighborUpdate(BlockState state, World world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) Deprecated.Called when a neighboring block is updated. This method should be overridden to perform an action with a side effect, most notably an activation of a redstone component. This can also be used to perform an action changing block states of other blocks, such asSpongeBlockwhich absorbs water.To replace the state of the block itself, override
getStateForNeighborUpdate(net.minecraft.block.BlockState, net.minecraft.util.math.Direction, net.minecraft.block.BlockState, net.minecraft.world.WorldAccess, net.minecraft.util.math.BlockPos, net.minecraft.util.math.BlockPos)instead.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 official aLdbx;a(Ldby;Lcmk;Lgu;Lcpl;Lgu;Z)Vintermediary method_9612Lnet/minecraft/class_4970;method_9612(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2248;Lnet/minecraft/class_2338;Z)Vnamed neighborUpdateLnet/minecraft/block/AbstractBlock;neighborUpdate(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/Block;Lnet/minecraft/util/math/BlockPos;Z)V
-
onBlockAdded
@Deprecated public void onBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean notify) Deprecated.Called server-side on the new block when the block state is changed. This includes block placement. When overriding this method,getStateForNeighborUpdate(net.minecraft.block.BlockState, net.minecraft.util.math.Direction, net.minecraft.block.BlockState, net.minecraft.world.WorldAccess, net.minecraft.util.math.BlockPos, net.minecraft.util.math.BlockPos)orneighborUpdate(net.minecraft.block.BlockState, net.minecraft.world.World, net.minecraft.util.math.BlockPos, net.minecraft.block.Block, net.minecraft.util.math.BlockPos, boolean)should also be overridden. The method is used in the following cases:- When activating a redstone component on placement (used along with
neighborUpdate(net.minecraft.block.BlockState, net.minecraft.world.World, net.minecraft.util.math.BlockPos, net.minecraft.block.Block, net.minecraft.util.math.BlockPos, boolean) - When resetting a position-dependent state (see
TargetBlock) - When converting a block on placement (see
WetSpongeBlock) - When fire lights a portal
- See Also:
- Mappings:
Namespace Name Mixin selector official bLdbx;b(Ldby;Lcmk;Lgu;Ldby;Z)Vintermediary method_9615Lnet/minecraft/class_4970;method_9615(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Z)Vnamed onBlockAddedLnet/minecraft/block/AbstractBlock;onBlockAdded(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Z)V
- When activating a redstone component on placement (used along with
-
onStateReplaced
@Deprecated public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) Deprecated.Called server-side on the old block when the block state is changed. This includes block removal. This is used to update neighboring blocks when an active redstone power source is removed, or to drop the contents of an inventory. The checkstate.isOf(newState.getBlock())can be used to see if the block was removed or not.- See Also:
- Mappings:
Namespace Name Mixin selector official aLdbx;a(Ldby;Lcmk;Lgu;Ldby;Z)Vintermediary method_9536Lnet/minecraft/class_4970;method_9536(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Z)Vnamed onStateReplacedLnet/minecraft/block/AbstractBlock;onStateReplaced(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Z)V
-
onUse
@Deprecated public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) Deprecated.Called when this block is used by a player. This, by default, is bound to using the right mouse button.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().If the action result is successful on a logical client, then the action will be sent to the logical server for processing.
- Returns:
- an action result that specifies if using the block was successful.
- Mappings:
Namespace Name Mixin selector official aLdbx;a(Ldby;Lcmk;Lgu;Lbym;Lbdv;Ledw;)Lbdw;intermediary method_9534Lnet/minecraft/class_4970;method_9534(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1657;Lnet/minecraft/class_1268;Lnet/minecraft/class_3965;)Lnet/minecraft/class_1269;named onUseLnet/minecraft/block/AbstractBlock;onUse(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/Hand;Lnet/minecraft/util/hit/BlockHitResult;)Lnet/minecraft/util/ActionResult;
-
onSyncedBlockEvent
@Deprecated public boolean onSyncedBlockEvent(BlockState state, World world, BlockPos pos, int type, int data) Deprecated.Handles the block event, which is an event specific to a block with an integer ID and data.- Returns:
- whether the event was handled successfully
- See Also:
- Mappings:
Namespace Name Mixin selector official aLdbx;a(Ldby;Lcmk;Lgu;II)Zintermediary method_9592Lnet/minecraft/class_4970;method_9592(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;II)Znamed onSyncedBlockEventLnet/minecraft/block/AbstractBlock;onSyncedBlockEvent(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;II)Z
-
getRenderType
Deprecated.Consider callingAbstractBlock.AbstractBlockState.getRenderType()instead. See why these methods are deprecated.Returns the block's render type (invisible, animated, model).- Returns:
- the block's render type (invisible, animated, model)
- API Note:
BlockWithEntityoverrides this to returnBlockRenderType.INVISIBLE; therefore, custom blocks extending that class must override it again to render the block.- Mappings:
Namespace Name Mixin selector official b_Ldbx;b_(Ldby;)Lcvp;intermediary method_9604Lnet/minecraft/class_4970;method_9604(Lnet/minecraft/class_2680;)Lnet/minecraft/class_2464;named getRenderTypeLnet/minecraft/block/AbstractBlock;getRenderType(Lnet/minecraft/block/BlockState;)Lnet/minecraft/block/BlockRenderType;
-
hasSidedTransparency
Deprecated.Consider callingAbstractBlock.AbstractBlockState.hasSidedTransparencyinstead. See why these methods are deprecated.Returns whether the block's transparency depends on the side of the block, like slabs.- Returns:
- whether the block's transparency depends on the side of the block, like slabs
- Mappings:
Namespace Name Mixin selector official g_Ldbx;g_(Ldby;)Zintermediary method_9526Lnet/minecraft/class_4970;method_9526(Lnet/minecraft/class_2680;)Znamed hasSidedTransparencyLnet/minecraft/block/AbstractBlock;hasSidedTransparency(Lnet/minecraft/block/BlockState;)Z
-
emitsRedstonePower
Deprecated.Consider callingAbstractBlock.AbstractBlockState.emitsRedstonePower()instead. See why these methods are deprecated.Returns whether the block is capable of emitting redstone power.This does not return whether the block is currently emitting redstone power. Use
RedstoneView.isEmittingRedstonePower(net.minecraft.util.math.BlockPos, net.minecraft.util.math.Direction)in that case.- Returns:
- whether the block is capable of emitting redstone power
- See Also:
- Mappings:
Namespace Name Mixin selector official f_Ldbx;f_(Ldby;)Zintermediary method_9506Lnet/minecraft/class_4970;method_9506(Lnet/minecraft/class_2680;)Znamed emitsRedstonePowerLnet/minecraft/block/AbstractBlock;emitsRedstonePower(Lnet/minecraft/block/BlockState;)Z
-
getFluidState
Deprecated.Consider callingAbstractBlock.AbstractBlockState.getFluidState()instead. See why these methods are deprecated.Returns the state's associated fluid state.Waterloggable blocks must override this to return
Fluids.WATER.getStill(false)when waterlogged.- Returns:
- the state's associated fluid state
- See Also:
- Mappings:
Namespace Name Mixin selector official c_Ldbx;c_(Ldby;)Ldxb;intermediary method_9545Lnet/minecraft/class_4970;method_9545(Lnet/minecraft/class_2680;)Lnet/minecraft/class_3610;named getFluidStateLnet/minecraft/block/AbstractBlock;getFluidState(Lnet/minecraft/block/BlockState;)Lnet/minecraft/fluid/FluidState;
-
hasComparatorOutput
Deprecated.Consider callingAbstractBlock.AbstractBlockState.hasComparatorOutput()instead. See why these methods are deprecated.Returns whether the block can have a comparator output.This does not check the current comparator output of the block. Use
getComparatorOutput(net.minecraft.block.BlockState, net.minecraft.world.World, net.minecraft.util.math.BlockPos)in that case.- Returns:
- whether the block can have a comparator output
- See Also:
- Mappings:
Namespace Name Mixin selector official d_Ldbx;d_(Ldby;)Zintermediary method_9498Lnet/minecraft/class_4970;method_9498(Lnet/minecraft/class_2680;)Znamed hasComparatorOutputLnet/minecraft/block/AbstractBlock;hasComparatorOutput(Lnet/minecraft/block/BlockState;)Z
-
getMaxHorizontalModelOffset
public float getMaxHorizontalModelOffset()- Mappings:
Namespace Name Mixin selector official al_Ldbx;al_()Fintermediary method_32913Lnet/minecraft/class_4970;method_32913()Fnamed getMaxHorizontalModelOffsetLnet/minecraft/block/AbstractBlock;getMaxHorizontalModelOffset()F
-
getVerticalModelOffsetMultiplier
public float getVerticalModelOffsetMultiplier()- Mappings:
Namespace Name Mixin selector official an_Ldbx;an_()Fintermediary method_37247Lnet/minecraft/class_4970;method_37247()Fnamed getVerticalModelOffsetMultiplierLnet/minecraft/block/AbstractBlock;getVerticalModelOffsetMultiplier()F
-
getRequiredFeatures
- Specified by:
getRequiredFeaturesin interfaceToggleableFeature- Mappings:
Namespace Name Mixin selector official mLcar;m()Lcau;intermediary method_45322Lnet/minecraft/class_7695;method_45322()Lnet/minecraft/class_7699;named getRequiredFeaturesLnet/minecraft/resource/featuretoggle/ToggleableFeature;getRequiredFeatures()Lnet/minecraft/resource/featuretoggle/FeatureSet;
-
rotate
Deprecated.Consider callingAbstractBlock.AbstractBlockState.rotate(net.minecraft.util.BlockRotation)instead. See why these methods are deprecated.Returnsstaterotated byrotation.By default, this returns the provided block state.
- Returns:
staterotated byrotation- Mappings:
Namespace Name Mixin selector official aLdbx;a(Ldby;Lcvw;)Ldby;intermediary method_9598Lnet/minecraft/class_4970;method_9598(Lnet/minecraft/class_2680;Lnet/minecraft/class_2470;)Lnet/minecraft/class_2680;named rotateLnet/minecraft/block/AbstractBlock;rotate(Lnet/minecraft/block/BlockState;Lnet/minecraft/util/BlockRotation;)Lnet/minecraft/block/BlockState;
-
mirror
Deprecated.Consider callingAbstractBlock.AbstractBlockState.mirror(net.minecraft.util.BlockMirror)instead. See why these methods are deprecated.Returnsstatemirrored bymirror.By default, this returns the provided block state.
- Returns:
statemirrored bymirror- Mappings:
Namespace Name Mixin selector official aLdbx;a(Ldby;Lcuf;)Ldby;intermediary method_9569Lnet/minecraft/class_4970;method_9569(Lnet/minecraft/class_2680;Lnet/minecraft/class_2415;)Lnet/minecraft/class_2680;named mirrorLnet/minecraft/block/AbstractBlock;mirror(Lnet/minecraft/block/BlockState;Lnet/minecraft/util/BlockMirror;)Lnet/minecraft/block/BlockState;
-
canReplace
Deprecated.Consider callingAbstractBlock.AbstractBlockState.canReplace(net.minecraft.item.ItemPlacementContext)instead. See why these methods are deprecated.Returns whether the item can replace the block.By default, this checks if the block allows replacing and whether the item differs from the block's item. Items composed of multiple blocks, such as candles, vines, or snow layers, should override this to implement additional checks.
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.- Returns:
- whether the item can replace the block
- See Also:
- Mappings:
Namespace Name Mixin selector official aLdbx;a(Ldby;Lcif;)Zintermediary method_9616Lnet/minecraft/class_4970;method_9616(Lnet/minecraft/class_2680;Lnet/minecraft/class_1750;)Znamed canReplaceLnet/minecraft/block/AbstractBlock;canReplace(Lnet/minecraft/block/BlockState;Lnet/minecraft/item/ItemPlacementContext;)Z
-
canBucketPlace
Deprecated.Consider callingAbstractBlock.AbstractBlockState.canBucketPlace(net.minecraft.fluid.Fluid)instead. See why these methods are deprecated.Returns whether a bucket can replace the block with the fluid.By default, this checks if the block allows replacing or is not solid. Blocks intended to be unbreakable should override this to implement additional checks.
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.- Returns:
- whether a bucket can replace the block with the fluid
- See Also:
- Mappings:
Namespace Name Mixin selector official aLdbx;a(Ldby;Ldxa;)Zintermediary method_22358Lnet/minecraft/class_4970;method_22358(Lnet/minecraft/class_2680;Lnet/minecraft/class_3611;)Znamed canBucketPlaceLnet/minecraft/block/AbstractBlock;canBucketPlace(Lnet/minecraft/block/BlockState;Lnet/minecraft/fluid/Fluid;)Z
-
getDroppedStacks
@Deprecated public List<ItemStack> getDroppedStacks(BlockState state, class_8567.class_8568 builder) Deprecated.Consider callingAbstractBlock.AbstractBlockState.getDroppedStacks(net.minecraft.class_8567.class_8568)instead. See why these methods are deprecated.Returns the block's dropped item stacks.The default implementation uses loot tables. Blocks with custom drops should not hardcode the drops; instead, make a new loot table. If the loot table needs an additional context, override this method and modify
builderbefore callingsuper.getDroppedStacks. An example of this isShulkerBoxBlock. Note that to prevent item duplication, when appending item stacks to the builder,ItemStack.split(int)should be called.This method should not be used for dropping inventory contents (
onStateReplaced(net.minecraft.block.BlockState, net.minecraft.world.World, net.minecraft.util.math.BlockPos, net.minecraft.block.BlockState, boolean)should be used instead) or to drop experience orbs (onStacksDropped(net.minecraft.block.BlockState, net.minecraft.server.world.ServerWorld, net.minecraft.util.math.BlockPos, net.minecraft.item.ItemStack, boolean)should be used instead).- Returns:
- the block's dropped item stacks
- See Also:
- Mappings:
Namespace Name Mixin selector official aLdbx;a(Ldby;Ldzn$a;)Ljava/util/List;intermediary method_9560Lnet/minecraft/class_4970;method_9560(Lnet/minecraft/class_2680;Lnet/minecraft/class_8567$class_8568;)Ljava/util/List;named getDroppedStacksLnet/minecraft/block/AbstractBlock;getDroppedStacks(Lnet/minecraft/block/BlockState;Lnet/minecraft/class_8567$class_8568;)Ljava/util/List;
-
getRenderingSeed
Deprecated.Consider callingAbstractBlock.AbstractBlockState.getRenderingSeed(net.minecraft.util.math.BlockPos)instead. See why these methods are deprecated.Returns the seed value for rendering.This is usually the hash code of
pos. Tall or wide blocks (such as doors or beds) should override this to make sure both parts of the block have the same seed.- Returns:
- the seed value for rendering
- Mappings:
Namespace Name Mixin selector official aLdbx;a(Ldby;Lgu;)Jintermediary method_9535Lnet/minecraft/class_4970;method_9535(Lnet/minecraft/class_2680;Lnet/minecraft/class_2338;)Jnamed getRenderingSeedLnet/minecraft/block/AbstractBlock;getRenderingSeed(Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;)J
-
getCullingShape
Deprecated.- Mappings:
Namespace Name Mixin selector official fLdbx;f(Ldby;Lclq;Lgu;)Leet;intermediary method_9571Lnet/minecraft/class_4970;method_9571(Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;)Lnet/minecraft/class_265;named getCullingShapeLnet/minecraft/block/AbstractBlock;getCullingShape(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/util/shape/VoxelShape;
-
getSidesShape
Deprecated.- Mappings:
Namespace Name Mixin selector official b_Ldbx;b_(Ldby;Lclq;Lgu;)Leet;intermediary method_25959Lnet/minecraft/class_4970;method_25959(Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;)Lnet/minecraft/class_265;named getSidesShapeLnet/minecraft/block/AbstractBlock;getSidesShape(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/util/shape/VoxelShape;
-
getRaycastShape
Deprecated.- Mappings:
Namespace Name Mixin selector official aLdbx;a(Ldby;Lclq;Lgu;)Leet;intermediary method_9584Lnet/minecraft/class_4970;method_9584(Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;)Lnet/minecraft/class_265;named getRaycastShapeLnet/minecraft/block/AbstractBlock;getRaycastShape(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/util/shape/VoxelShape;
-
getOpacity
Deprecated.- Mappings:
Namespace Name Mixin selector official gLdbx;g(Ldby;Lclq;Lgu;)Iintermediary method_9505Lnet/minecraft/class_4970;method_9505(Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;)Inamed getOpacityLnet/minecraft/block/AbstractBlock;getOpacity(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;)I
-
createScreenHandlerFactory
@Nullable @Deprecated public @Nullable NamedScreenHandlerFactory createScreenHandlerFactory(BlockState state, World world, BlockPos pos) Deprecated.Returns the screen handler factory ornullif screen handler cannot be created.This method should be overridden for blocks with screen handlers, such as anvils. The created screen handler is usually passed to
PlayerEntity.openHandledScreen(net.minecraft.screen.NamedScreenHandlerFactory). SeeAnvilBlock.createScreenHandlerFactory(net.minecraft.block.BlockState, net.minecraft.world.World, net.minecraft.util.math.BlockPos)for basic usage.BlockWithEntitydelegates this logic to the block entity implementingNamedScreenHandlerFactory. For example, anyBlockWithEntitywhose block entity extendsLockableContainerBlockEntityneeds to overrideLockableContainerBlockEntity.createScreenHandler(int, net.minecraft.entity.player.PlayerInventory)instead of this method.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.- Returns:
- the screen handler factory or
nullif screen handler cannot be created - See Also:
- Mappings:
Namespace Name Mixin selector official bLdbx;b(Ldby;Lcmk;Lgu;)Lbdz;intermediary method_17454Lnet/minecraft/class_4970;method_17454(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;)Lnet/minecraft/class_3908;named createScreenHandlerFactoryLnet/minecraft/block/AbstractBlock;createScreenHandlerFactory(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/screen/NamedScreenHandlerFactory;
-
canPlaceAt
Deprecated.Returns whether the block can be placed atpos.Blocks with supporting block requirements should override this method. Note that this should also be checked manually during
getStateForNeighborUpdate(net.minecraft.block.BlockState, net.minecraft.util.math.Direction, net.minecraft.block.BlockState, net.minecraft.world.WorldAccess, net.minecraft.util.math.BlockPos, net.minecraft.util.math.BlockPos)in order to break the block that lost its supporting block.This is only checked during the use of block items or by endermen, falling blocks, etc that can place blocks. This does not affect block state changes performed through
World.setBlockState(BlockPos, BlockState)call.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.- Returns:
- whether the block can be placed at
pos - See Also:
- Mappings:
Namespace Name Mixin selector official aLdbx;a(Ldby;Lcmn;Lgu;)Zintermediary method_9558Lnet/minecraft/class_4970;method_9558(Lnet/minecraft/class_2680;Lnet/minecraft/class_4538;Lnet/minecraft/class_2338;)Znamed canPlaceAtLnet/minecraft/block/AbstractBlock;canPlaceAt(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/WorldView;Lnet/minecraft/util/math/BlockPos;)Z
-
getAmbientOcclusionLightLevel
@Deprecated public float getAmbientOcclusionLightLevel(BlockState state, BlockView world, BlockPos pos) Deprecated.- Mappings:
Namespace Name Mixin selector official bLdbx;b(Ldby;Lclq;Lgu;)Fintermediary method_9575Lnet/minecraft/class_4970;method_9575(Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;)Fnamed getAmbientOcclusionLightLevelLnet/minecraft/block/AbstractBlock;getAmbientOcclusionLightLevel(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;)F
-
getComparatorOutput
Deprecated.Returns the comparator output of the block, from0to15.When overriding this,
hasComparatorOutput(net.minecraft.block.BlockState)must also be overridden.- Returns:
- the comparator output of the block, from
0to15 - See Also:
- Mappings:
Namespace Name Mixin selector official aLdbx;a(Ldby;Lcmk;Lgu;)Iintermediary method_9572Lnet/minecraft/class_4970;method_9572(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;)Inamed getComparatorOutputLnet/minecraft/block/AbstractBlock;getComparatorOutput(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)I
-
getOutlineShape
@Deprecated public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) Deprecated.Consider callingAbstractBlock.AbstractBlockState.getOutlineShape(BlockView, BlockPos, ShapeContext)instead. See why these methods are deprecated.- Mappings:
Namespace Name Mixin selector official aLdbx;a(Ldby;Lclq;Lgu;Leef;)Leet;intermediary method_9530Lnet/minecraft/class_4970;method_9530(Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;Lnet/minecraft/class_3726;)Lnet/minecraft/class_265;named getOutlineShapeLnet/minecraft/block/AbstractBlock;getOutlineShape(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/ShapeContext;)Lnet/minecraft/util/shape/VoxelShape;
-
getCollisionShape
@Deprecated public VoxelShape getCollisionShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) Deprecated.Consider callingAbstractBlock.AbstractBlockState.getCollisionShape(BlockView, BlockPos, ShapeContext)instead. See why these methods are deprecated.- Mappings:
Namespace Name Mixin selector official cLdbx;c(Ldby;Lclq;Lgu;Leef;)Leet;intermediary method_9549Lnet/minecraft/class_4970;method_9549(Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;Lnet/minecraft/class_3726;)Lnet/minecraft/class_265;named getCollisionShapeLnet/minecraft/block/AbstractBlock;getCollisionShape(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/ShapeContext;)Lnet/minecraft/util/shape/VoxelShape;
-
isShapeFullCube
Deprecated.- Mappings:
Namespace Name Mixin selector official a_Ldbx;a_(Ldby;Lclq;Lgu;)Zintermediary method_37403Lnet/minecraft/class_4970;method_37403(Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;)Znamed isShapeFullCubeLnet/minecraft/block/AbstractBlock;isShapeFullCube(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;)Z
-
isCullingShapeFullCube
Deprecated.- Mappings:
Namespace Name Mixin selector official hLdbx;h(Ldby;Lclq;Lgu;)Zintermediary method_42326Lnet/minecraft/class_4970;method_42326(Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;)Znamed isCullingShapeFullCubeLnet/minecraft/block/AbstractBlock;isCullingShapeFullCube(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;)Z
-
getCameraCollisionShape
@Deprecated public VoxelShape getCameraCollisionShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) Deprecated.- Mappings:
Namespace Name Mixin selector official bLdbx;b(Ldby;Lclq;Lgu;Leef;)Leet;intermediary method_26159Lnet/minecraft/class_4970;method_26159(Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;Lnet/minecraft/class_3726;)Lnet/minecraft/class_265;named getCameraCollisionShapeLnet/minecraft/block/AbstractBlock;getCameraCollisionShape(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/ShapeContext;)Lnet/minecraft/util/shape/VoxelShape;
-
randomTick
@Deprecated public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random random) Deprecated.Called server-side when a block gets ticked randomly. This can be overridden to implement various logics, most commonly plant growth. Default implementation callsscheduledTick(net.minecraft.block.BlockState, net.minecraft.server.world.ServerWorld, net.minecraft.util.math.BlockPos, net.minecraft.util.math.random.Random). To control the rate of the action, userandom.Random tick speed is controlled by the game rule
randomTickSpeedand can be disabled. Only blocks within 128-block cylinder (i.e. ignoring Y coordinates) around players receive random ticks.Blocks overriding this must use
AbstractBlock.Settings.ticksRandomly()block settings.Here are some examples:
SugarCaneBlockuses this to grow sugar cane.OxidizableBlockuses this to oxidize.NetherPortalBlockuses this to spawn zombified piglins.LeavesBlockuses this to decay when far from logs.
- See Also:
- Mappings:
Namespace Name Mixin selector official bLdbx;b(Ldby;Laif;Lgu;Lapf;)Vintermediary method_9514Lnet/minecraft/class_4970;method_9514(Lnet/minecraft/class_2680;Lnet/minecraft/class_3218;Lnet/minecraft/class_2338;Lnet/minecraft/class_5819;)Vnamed randomTickLnet/minecraft/block/AbstractBlock;randomTick(Lnet/minecraft/block/BlockState;Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/random/Random;)V
-
scheduledTick
@Deprecated public void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, Random random) Deprecated.Called server-side when a block receives a scheduled tick. This can be used like a timer. Scheduled ticks are added usingWorldAccess.scheduleBlockTick(BlockPos, Block, int). Additionally,randomTick(net.minecraft.block.BlockState, net.minecraft.server.world.ServerWorld, net.minecraft.util.math.BlockPos, net.minecraft.util.math.random.Random)by default calls this method; overriderandomTick(net.minecraft.block.BlockState, net.minecraft.server.world.ServerWorld, net.minecraft.util.math.BlockPos, net.minecraft.util.math.random.Random)to disable this behavior.Scheduled ticks are often used inside
getStateForNeighborUpdate(net.minecraft.block.BlockState, net.minecraft.util.math.Direction, net.minecraft.block.BlockState, net.minecraft.world.WorldAccess, net.minecraft.util.math.BlockPos, net.minecraft.util.math.BlockPos).Here are some examples:
SugarCaneBlockchecks the placement requirement.DispenserBlockdispenses its content.CommandBlockexecutes its command.FrogspawnBlockspawns a tadpole.SoulSandBlockupdates a bubble column.FallingBlocktries to fall.
- See Also:
- Mappings:
Namespace Name Mixin selector official aLdbx;a(Ldby;Laif;Lgu;Lapf;)Vintermediary method_9588Lnet/minecraft/class_4970;method_9588(Lnet/minecraft/class_2680;Lnet/minecraft/class_3218;Lnet/minecraft/class_2338;Lnet/minecraft/class_5819;)Vnamed scheduledTickLnet/minecraft/block/AbstractBlock;scheduledTick(Lnet/minecraft/block/BlockState;Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/random/Random;)V
-
calcBlockBreakingDelta
@Deprecated public float calcBlockBreakingDelta(BlockState state, PlayerEntity player, BlockView world, BlockPos pos) Deprecated.- Mappings:
Namespace Name Mixin selector official aLdbx;a(Ldby;Lbym;Lclq;Lgu;)Fintermediary method_9594Lnet/minecraft/class_4970;method_9594(Lnet/minecraft/class_2680;Lnet/minecraft/class_1657;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;)Fnamed calcBlockBreakingDeltaLnet/minecraft/block/AbstractBlock;calcBlockBreakingDelta(Lnet/minecraft/block/BlockState;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;)F
-
onStacksDropped
@Deprecated public void onStacksDropped(BlockState state, ServerWorld world, BlockPos pos, ItemStack tool, boolean dropExperience) Deprecated.Called server-side when the stacks are dropped by mining or explosion. This is mostly overridden to drop experience orbs. To change the dropped item stacks, use loot tables orgetDroppedStacks(net.minecraft.block.BlockState, net.minecraft.class_8567.class_8568). To drop inventory contents, useonStateReplaced(net.minecraft.block.BlockState, net.minecraft.world.World, net.minecraft.util.math.BlockPos, net.minecraft.block.BlockState, boolean)instead.Experience orbs should only be dropped if
dropExperienceistrue.Block.dropExperienceWhenMined(net.minecraft.server.world.ServerWorld, net.minecraft.util.math.BlockPos, net.minecraft.item.ItemStack, net.minecraft.util.math.intprovider.IntProvider)can be used to drop experience orbs.ExperienceDroppingBlockprovides the implementation for experience-dropping blocks.- See Also:
- Mappings:
Namespace Name Mixin selector official aLdbx;a(Ldby;Laif;Lgu;Lcfx;Z)Vintermediary method_9565Lnet/minecraft/class_4970;method_9565(Lnet/minecraft/class_2680;Lnet/minecraft/class_3218;Lnet/minecraft/class_2338;Lnet/minecraft/class_1799;Z)Vnamed onStacksDroppedLnet/minecraft/block/AbstractBlock;onStacksDropped(Lnet/minecraft/block/BlockState;Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/item/ItemStack;Z)V
-
onBlockBreakStart
@Deprecated public void onBlockBreakStart(BlockState state, World world, BlockPos pos, PlayerEntity player) Deprecated.Called when a player starts breaking the block (including when instant-mining).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 official aLdbx;a(Ldby;Lcmk;Lgu;Lbym;)Vintermediary method_9606Lnet/minecraft/class_4970;method_9606(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1657;)Vnamed onBlockBreakStartLnet/minecraft/block/AbstractBlock;onBlockBreakStart(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/player/PlayerEntity;)V
-
getWeakRedstonePower
@Deprecated public int getWeakRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction) Deprecated.Returns the weak redstone power emitted from the block.When overriding this, make sure to also override
emitsRedstonePower(net.minecraft.block.BlockState)to returntrue.Weak redstone power is a power that cannot power a redstone wire when a solid block is in between. For example,
RedstoneBlockandTargetBlockemits weak redstone power only.LeverBlockandButtonBlockemits both weak and strong redstone power depending on the direction.- Returns:
- the weak redstone power emitted from the block
- See Also:
- Mappings:
Namespace Name Mixin selector official aLdbx;a(Ldby;Lclq;Lgu;Lha;)Iintermediary method_9524Lnet/minecraft/class_4970;method_9524(Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;Lnet/minecraft/class_2350;)Inamed getWeakRedstonePowerLnet/minecraft/block/AbstractBlock;getWeakRedstonePower(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;)I
-
onEntityCollision
@Deprecated public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) Deprecated.Called when the entity's collision box intersects the block. Therefore, this method is not called for blocks with a collision; useBlock.onSteppedOn(net.minecraft.world.World, net.minecraft.util.math.BlockPos, net.minecraft.block.BlockState, net.minecraft.entity.Entity)for those blocks.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.Here are some examples:
CactusBlockdamages the entity.AbstractPressurePlateBlocktriggers.CobwebBlockslows the entity.EndPortalBlockteleports the entity.HopperBlockcollects the item entity.
- See Also:
- Mappings:
Namespace Name Mixin selector official aLdbx;a(Ldby;Lcmk;Lgu;Lbfh;)Vintermediary method_9548Lnet/minecraft/class_4970;method_9548(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1297;)Vnamed onEntityCollisionLnet/minecraft/block/AbstractBlock;onEntityCollision(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/Entity;)V
-
getStrongRedstonePower
@Deprecated public int getStrongRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction) Deprecated.Returns the strong redstone power emitted from the block.When overriding this, make sure to also override
emitsRedstonePower(net.minecraft.block.BlockState)to returntrue.getWeakRedstonePower(net.minecraft.block.BlockState, net.minecraft.world.BlockView, net.minecraft.util.math.BlockPos, net.minecraft.util.math.Direction)might also need to be overridden.Strong redstone power is a power that can power a redstone wire when a solid block is in between. For example,
RedstoneBlockandTargetBlockemits weak redstone power only.LeverBlockandButtonBlockemits both weak and strong redstone power.- Returns:
- the strong redstone power emitted from the block
- See Also:
- Mappings:
Namespace Name Mixin selector official bLdbx;b(Ldby;Lclq;Lgu;Lha;)Iintermediary method_9603Lnet/minecraft/class_4970;method_9603(Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;Lnet/minecraft/class_2350;)Inamed getStrongRedstonePowerLnet/minecraft/block/AbstractBlock;getStrongRedstonePower(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;)I
-
getLootTableId
- Mappings:
Namespace Name Mixin selector official rLdbx;r()Lacq;intermediary method_26162Lnet/minecraft/class_4970;method_26162()Lnet/minecraft/class_2960;named getLootTableIdLnet/minecraft/block/AbstractBlock;getLootTableId()Lnet/minecraft/util/Identifier;
-
onProjectileHit
@Deprecated public void onProjectileHit(World world, BlockState state, BlockHitResult hit, ProjectileEntity projectile) Deprecated.Called when aProjectileEntityhits a 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.Here are some examples:
TargetBlockactivates.BellBlockrings.LightningRodBlockspawns a lightning.AbstractCandleBlocklights on fire when hit by a projectile on fire.
- See Also:
- Mappings:
Namespace Name Mixin selector official aLdbx;a(Lcmk;Ldby;Ledw;Lbze;)Vintermediary method_19286Lnet/minecraft/class_4970;method_19286(Lnet/minecraft/class_1937;Lnet/minecraft/class_2680;Lnet/minecraft/class_3965;Lnet/minecraft/class_1676;)Vnamed onProjectileHitLnet/minecraft/block/AbstractBlock;onProjectileHit(Lnet/minecraft/world/World;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/hit/BlockHitResult;Lnet/minecraft/entity/projectile/ProjectileEntity;)V
-
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.- Returns:
- the block's corresponding item
- See Also:
- Mappings:
Namespace Name Mixin selector official kLdbx;k()Lcfs;intermediary method_8389Lnet/minecraft/class_4970;method_8389()Lnet/minecraft/class_1792;named asItemLnet/minecraft/block/AbstractBlock;asItem()Lnet/minecraft/item/Item;
-
asBlock
Returns the block asBlock.This is used for casting purposes.
- Returns:
- the block as
Block - Mappings:
Namespace Name Mixin selector official pLdbx;p()Lcpl;intermediary method_26160Lnet/minecraft/class_4970;method_26160()Lnet/minecraft/class_2248;named asBlockLnet/minecraft/block/AbstractBlock;asBlock()Lnet/minecraft/block/Block;
-
getDefaultMapColor
- Mappings:
Namespace Name Mixin selector official sLdbx;s()Ldxf;intermediary method_26403Lnet/minecraft/class_4970;method_26403()Lnet/minecraft/class_3620;named getDefaultMapColorLnet/minecraft/block/AbstractBlock;getDefaultMapColor()Lnet/minecraft/block/MapColor;
-
getHardness
public float getHardness()- Mappings:
Namespace Name Mixin selector official tLdbx;t()Fintermediary method_36555Lnet/minecraft/class_4970;method_36555()Fnamed getHardnessLnet/minecraft/block/AbstractBlock;getHardness()F
-
AbstractBlock.AbstractBlockState.calcBlockBreakingDelta(net.minecraft.entity.player.PlayerEntity, net.minecraft.world.BlockView, net.minecraft.util.math.BlockPos)instead.