CLASS net/minecraft/class_4970 net/minecraft/block/AbstractBlock COMMENT An abstract class that defines some logic for {@link Block blocks}. COMMENT This class should not be extended directly. Extend {@link Block} instead. COMMENT Custom block behaviors are specified either through {@linkplain AbstractBlock.Settings COMMENT block settings} or by overriding methods in this class. COMMENT COMMENT
Methods in this class may be executed during world generation if they take COMMENT {@link WorldAccess} as a parameter. In this case, a {@link net.minecraft.world.ChunkRegion} COMMENT is passed to the parameter, which is not a subclass of {@link World}. COMMENT COMMENT
Deprecated methods in this class mean they COMMENT should only be called from the corresponding method in {@link COMMENT AbstractBlockState} or subclasses of this class. Overriding the COMMENT methods is an expected usage and is not deprecated in any way. COMMENT COMMENT @apiNote In vanilla subclasses, these methods are called either to do the COMMENT default behavior (e.g. {@code super.onUse(...)}) or to delegate logic to COMMENT other blocks (e.g. {@link net.minecraft.block.StairsBlock#randomTick COMMENT StairsBlock#randomTick} calls {@code randomTick} of its base block). COMMENT COMMENT
Many methods of this class are called on both the logical client and logical server, COMMENT so take caution when using those methods. The logical side can be checked using COMMENT {@link World#isClient}. COMMENT COMMENT
Notes: "Tall or wide block" refers to a block that COMMENT has multiple parts, such as doors, sunflowers, or beds. "Neighboring COMMENT block" refers to blocks adjacent to a block on all 6 sides (but not COMMENT diagonally.) COMMENT COMMENT
Method | COMMENTPurpose | COMMENTPlayer/dispenser | COMMENTFalling block | COMMENT{@link World#setBlockState(BlockPos, BlockState) setBlockState} call | COMMENT
---|---|---|---|---|
oldState.{@link #canReplace canReplace} | COMMENTChecking if the current block can be replaced | COMMENTYes | COMMENTYes | COMMENTNo | COMMENT
newBlock.{@link Block#getPlacementState getPlacementState} | COMMENTGetting the placed state | COMMENTYes | COMMENTYes | COMMENTNo | COMMENT
newState.{@link #canPlaceAt canPlaceAt} | COMMENTChecking the block's placement restriction | COMMENTYes | COMMENTYes | COMMENTNo | COMMENT
oldState.{@link #onStateReplaced onStateReplaced} | COMMENTDropping inventory, updating redstone circuit, etc | COMMENTYes | COMMENTYes | COMMENTYes | COMMENT
newState.{@link #onBlockAdded onBlockAdded} | COMMENTActivating redstone component, etc | COMMENTYes | COMMENTYes | COMMENTYes | COMMENT
neighborState.{@link #neighborUpdate neighborUpdate} | COMMENTActivating neighboring redstone component, etc | COMMENTYes | COMMENTYes | COMMENTYes | COMMENT
oldState.{@link #prepare prepare} | COMMENTUpdating redstone wire connection | COMMENTYes | COMMENTYes | COMMENTYes | COMMENT
neighborState.{@link #getStateForNeighborUpdate getStateForNeighborUpdate} | COMMENTChecking the neighboring block's placement restriction, updating connection, etc | COMMENTYes | COMMENTYes | COMMENTYes | COMMENT
newState.{@link #prepare prepare} | COMMENTUpdating redstone wire connection | COMMENTYes | COMMENTYes | COMMENTYes | COMMENT
newBlock.{@link Block#onPlaced onPlaced} | COMMENTPlacing the other half of tall or wide block, setting block entity's custom name, etc | COMMENTYes | COMMENTNo | COMMENTNo | COMMENT
Method | COMMENTPurpose | COMMENTPlayer mining | COMMENTExplosion | COMMENT{@link World#setBlockState(BlockPos, BlockState) setBlockState} / {@link net.minecraft.world.ModifiableWorld#removeBlock(BlockPos, boolean) removeBlock} call | COMMENT{@link net.minecraft.world.ModifiableWorld#breakBlock(BlockPos, boolean) breakBlock} call | COMMENT
---|---|---|---|---|---|
state.{@link #onBlockBreakStart onBlockBreakStart} | COMMENTDoing something when player starts breaking a block | COMMENTYes | COMMENTNo | COMMENTNo | COMMENTNo | COMMENT
state.{@link #calcBlockBreakingDelta calcBlockBreakingDelta} | COMMENTCalculating the player's mining speed | COMMENTYes | COMMENTNo | COMMENTNo | COMMENTNo | COMMENT
block.{@link Block#onBreak onBreak} | COMMENTSpawning particles, breaking the other half of tall or wide block, etc | COMMENTYes | COMMENTNo | COMMENTNo | COMMENTNo | COMMENT
state.{@link #onStateReplaced onStateReplaced} | COMMENTDropping inventory, updating redstone circuit, etc | COMMENTYes | COMMENTYes | COMMENTYes | COMMENTYes | COMMENT
neighborState.{@link #neighborUpdate neighborUpdate} | COMMENTActivating neighboring redstone component, etc | COMMENTYes | COMMENTYes | COMMENTYes | COMMENTYes | COMMENT
state.{@link #prepare prepare} | COMMENTUpdating redstone wire connection | COMMENTYes | COMMENTYes | COMMENTYes | COMMENTYes | COMMENT
neighborState.{@link #getStateForNeighborUpdate getStateForNeighborUpdate} | COMMENTChecking the neighboring block's placement restriction, updating connection, etc | COMMENTYes | COMMENTYes | COMMENTYes | COMMENTYes | COMMENT
block.{@link Block#onBroken onBroken} | COMMENTUnused in most cases | COMMENTYes | COMMENTNo | COMMENTNo | COMMENTNo | COMMENT
block.{@link Block#afterBreak afterBreak} | COMMENTDropping stacks, replacing the broken block with another block, etc | COMMENTYes | COMMENTNo | COMMENTNo | COMMENTNo | COMMENT
state.{@link #getDroppedStacks getDroppedStacks} | COMMENTSupplying information to loot context builder | COMMENTYes | COMMENTYes | COMMENTYes | COMMENTYes1 | COMMENT
state.{@link #onStacksDropped onStacksDropped} | COMMENTDropping experience orbs | COMMENTYes | COMMENTYes2 | COMMENTYes | COMMENTYes1 | COMMENT
Notes: COMMENT
This method should be overridden for blocks with screen handlers, such as anvils. COMMENT The created screen handler is usually passed to {@link PlayerEntity#openHandledScreen}. COMMENT See {@link AnvilBlock#createScreenHandlerFactory} for basic usage. {@link BlockWithEntity} COMMENT delegates this logic to the block entity implementing {@link COMMENT net.minecraft.screen.NamedScreenHandlerFactory}. For example, any {@link BlockWithEntity} whose block entity COMMENT extends {@link net.minecraft.block.entity.LockableContainerBlockEntity} needs to override COMMENT {@link net.minecraft.block.entity.LockableContainerBlockEntity#createScreenHandler} COMMENT instead of this method. COMMENT COMMENT
This method is called on both the logical client and logical server, so take caution COMMENT when overriding this method. The logical side can be checked using {@link COMMENT World#isClient}. COMMENT COMMENT @deprecated Consider calling {@link AbstractBlockState#createScreenHandlerFactory} instead. See why these methods are deprecated. COMMENT COMMENT @see net.minecraft.screen.SimpleNamedScreenHandlerFactory COMMENT @see net.minecraft.block.entity.LockableContainerBlockEntity ARG 1 state ARG 2 world ARG 3 pos METHOD method_19286 onProjectileHit (Lnet/minecraft/class_1937;Lnet/minecraft/class_2680;Lnet/minecraft/class_3965;Lnet/minecraft/class_1676;)V COMMENT Called when a {@link ProjectileEntity} hits a block. COMMENT COMMENT
This method is called on both the logical client and logical server, so take caution COMMENT when overriding this method. The logical side can be checked using {@link COMMENT World#isClient}. COMMENT COMMENT
Here are some examples: COMMENT
By default, this checks if the block allows replacing or is not solid. COMMENT Blocks intended to be unbreakable should override this to implement additional checks. COMMENT COMMENT
This method is called on both the logical client and logical server, so take caution COMMENT when overriding this method. The logical side can be checked using {@link COMMENT World#isClient}. COMMENT COMMENT @deprecated Consider calling {@link AbstractBlockState#canBucketPlace} instead. See why these methods are deprecated. COMMENT COMMENT @see #canReplace COMMENT @see AbstractBlockState#isReplaceable ARG 1 state ARG 2 fluid METHOD method_25959 getSidesShape (Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;)Lnet/minecraft/class_265; COMMENT @deprecated Consider calling {@link AbstractBlockState#getSidesShape} instead. See why these methods are deprecated. ARG 1 state ARG 2 world ARG 3 pos METHOD method_26159 getCameraCollisionShape (Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;Lnet/minecraft/class_3726;)Lnet/minecraft/class_265; COMMENT @deprecated Consider calling {@link AbstractBlockState#getCameraCollisionShape} instead. See why these methods are deprecated. ARG 1 state ARG 2 world ARG 3 pos ARG 4 context METHOD method_26160 asBlock ()Lnet/minecraft/class_2248; COMMENT {@return the block as {@link Block}} COMMENT COMMENT
This is used for casting purposes. METHOD method_26162 getLootTableId ()Lnet/minecraft/class_2960; METHOD method_26403 getDefaultMapColor ()Lnet/minecraft/class_3620; METHOD method_32913 getMaxHorizontalModelOffset ()F METHOD method_36555 getHardness ()F METHOD method_37247 getVerticalModelOffsetMultiplier ()F METHOD method_37403 isShapeFullCube (Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;)Z COMMENT @deprecated Consider calling {@link AbstractBlockState#isFullCube} instead. See why these methods are deprecated. ARG 1 state ARG 2 world ARG 3 pos METHOD method_42326 isCullingShapeFullCube (Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;)Z ARG 1 state ARG 2 world ARG 3 pos METHOD method_8389 asItem ()Lnet/minecraft/class_1792; COMMENT {@return the block's corresponding item} COMMENT COMMENT
This is not affected by loot tables. Blocks without corresponding items, COMMENT such as piston head, will return {@link net.minecraft.item.Items#AIR}. COMMENT COMMENT @see net.minecraft.item.BlockItem METHOD method_9498 hasComparatorOutput (Lnet/minecraft/class_2680;)Z COMMENT {@return whether the block can have a comparator output} COMMENT COMMENT
This does not check the current comparator output of the block. COMMENT Use {@link #getComparatorOutput} in that case. COMMENT COMMENT @deprecated Consider calling {@link AbstractBlockState#hasComparatorOutput} instead. See why these methods are deprecated. COMMENT COMMENT @see #getComparatorOutput ARG 1 state METHOD method_9505 getOpacity (Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;)I COMMENT @deprecated Consider calling {@link AbstractBlockState#getOpacity} instead. See why these methods are deprecated. ARG 1 state ARG 2 world ARG 3 pos METHOD method_9506 emitsRedstonePower (Lnet/minecraft/class_2680;)Z COMMENT {@return whether the block is capable of emitting redstone power} COMMENT COMMENT
This does not return whether the block is currently emitting redstone power. COMMENT Use {@link World#isEmittingRedstonePower} in that case. COMMENT COMMENT @deprecated Consider calling {@link AbstractBlockState#emitsRedstonePower} instead. See why these methods are deprecated. COMMENT COMMENT @see World#isEmittingRedstonePower ARG 1 state METHOD method_9514 randomTick (Lnet/minecraft/class_2680;Lnet/minecraft/class_3218;Lnet/minecraft/class_2338;Lnet/minecraft/class_5819;)V COMMENT Called server-side when a block gets ticked randomly. This can be overridden to implement COMMENT various logics, most commonly plant growth. Default implementation calls COMMENT {@link #scheduledTick}. To control the rate of the action, use {@code random}. COMMENT COMMENT
Random tick speed is controlled by the game rule {@link COMMENT net.minecraft.world.GameRules#RANDOM_TICK_SPEED randomTickSpeed} and can be disabled. COMMENT Only blocks within 128-block cylinder (i.e. ignoring Y coordinates) around players COMMENT receive random ticks. COMMENT COMMENT
Blocks overriding this must use {@link AbstractBlock.Settings#ticksRandomly} COMMENT block settings. COMMENT COMMENT
Here are some examples: COMMENT
This method is called on both the logical client and logical server, so take caution COMMENT when overriding this method. The logical side can be checked using {@link COMMENT World#isClient}. COMMENT COMMENT @apiNote This is used by {@link RedstoneWireBlock} to update connected redstone wire. COMMENT COMMENT @deprecated Consider calling {@link AbstractBlockState#prepare(WorldAccess, BlockPos, int, int)} instead. See why these methods are deprecated. COMMENT COMMENT @see #getStateForNeighborUpdate COMMENT @see #neighborUpdate ARG 1 state ARG 2 world ARG 3 pos ARG 4 flags ARG 5 maxUpdateDepth METHOD method_9522 isSideInvisible (Lnet/minecraft/class_2680;Lnet/minecraft/class_2680;Lnet/minecraft/class_2350;)Z COMMENT @deprecated Consider calling {@link AbstractBlockState#isSideInvisible} instead. See why these methods are deprecated. ARG 1 state ARG 2 stateFrom ARG 3 direction METHOD method_9524 getWeakRedstonePower (Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;Lnet/minecraft/class_2350;)I COMMENT {@return the weak redstone power emitted from the block} COMMENT COMMENT
When overriding this, make sure to also override {@link #emitsRedstonePower} to COMMENT return {@code true}. COMMENT COMMENT
Weak redstone power is a power that cannot power a redstone wire when a solid block COMMENT is in between. For example, {@link RedstoneBlock} and {@link TargetBlock} emits weak COMMENT redstone power only. {@link LeverBlock} and {@link ButtonBlock} emits both COMMENT weak and strong redstone power depending on the direction. COMMENT COMMENT @deprecated Consider calling {@link AbstractBlockState#getWeakRedstonePower} instead. See why these methods are deprecated. COMMENT COMMENT @see #emitsRedstonePower COMMENT @see #getStrongRedstonePower COMMENT @see net.minecraft.world.RedstoneView#isReceivingRedstonePower ARG 1 state ARG 2 world ARG 3 pos ARG 4 direction METHOD method_9526 hasSidedTransparency (Lnet/minecraft/class_2680;)Z COMMENT {@return whether the block's transparency depends on the side of the block, like slabs} COMMENT COMMENT @deprecated Consider calling {@link AbstractBlockState#hasSidedTransparency} instead. See why these methods are deprecated. ARG 1 state METHOD method_9530 getOutlineShape (Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;Lnet/minecraft/class_3726;)Lnet/minecraft/class_265; COMMENT @deprecated Consider calling {@link AbstractBlockState#getOutlineShape(BlockView, BlockPos, ShapeContext)} instead. See why these methods are deprecated. ARG 1 state ARG 2 world ARG 3 pos ARG 4 context METHOD method_9534 onUse (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; COMMENT Called when this block is used by a player. COMMENT This, by default, is bound to using the right mouse button. COMMENT COMMENT
This method is called on both the logical client and logical server, so take caution when overriding this method. COMMENT The logical side can be checked using {@link net.minecraft.world.World#isClient() world.isClient()}. COMMENT COMMENT
If the action result is successful on a logical client, then the action will be sent to the logical server for processing. COMMENT COMMENT @return an action result that specifies if using the block was successful. COMMENT COMMENT @deprecated Consider calling {@link AbstractBlockState#onUse} instead. See why these methods are deprecated. ARG 1 state ARG 2 world ARG 3 pos ARG 4 player ARG 5 hand ARG 6 hit METHOD method_9535 getRenderingSeed (Lnet/minecraft/class_2680;Lnet/minecraft/class_2338;)J COMMENT {@return the seed value for rendering} COMMENT COMMENT
This is usually the hash code of {@code pos}. Tall or wide blocks (such as doors or COMMENT beds) should override this to make sure both parts of the block have the same seed. COMMENT COMMENT @deprecated Consider calling {@link AbstractBlockState#getRenderingSeed} instead. See why these methods are deprecated. ARG 1 state ARG 2 pos METHOD method_9536 onStateReplaced (Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Z)V COMMENT Called server-side on the old block when the block state is changed. This includes block COMMENT removal. This is used to update neighboring blocks when an active redstone power source COMMENT is removed, or to drop the contents of an inventory. The check {@code COMMENT state.isOf(newState.getBlock())} can be used to see if the block was removed or not. COMMENT COMMENT @deprecated Consider calling {@link AbstractBlockState#onStateReplaced} instead. See why these methods are deprecated. COMMENT COMMENT @see net.minecraft.util.ItemScatterer#spawn(World, BlockPos, net.minecraft.inventory.Inventory) COMMENT @see #onBlockAdded ARG 1 state ARG 2 world ARG 3 pos ARG 4 newState ARG 5 moved METHOD method_9545 getFluidState (Lnet/minecraft/class_2680;)Lnet/minecraft/class_3610; COMMENT {@return the state's associated fluid state} COMMENT COMMENT
{@linkplain Waterloggable Waterloggable blocks} must override this to return {@code Fluids.WATER.getStill(false)} COMMENT when waterlogged. COMMENT COMMENT @deprecated Consider calling {@link AbstractBlockState#getFluidState} instead. See why these methods are deprecated. COMMENT COMMENT @see net.minecraft.fluid.Fluids#WATER ARG 1 state METHOD method_9548 onEntityCollision (Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1297;)V COMMENT Called when the entity's collision box intersects the block. Therefore, COMMENT this method is not called for blocks with a collision; use {@link Block#onSteppedOn} COMMENT for those blocks. COMMENT COMMENT
This method is called on both the logical client and logical server, so take caution COMMENT when overriding this method. The logical side can be checked using {@link COMMENT World#isClient}. COMMENT COMMENT
Here are some examples: COMMENT
Blocks with supporting block requirements should override this method. Note that COMMENT this should also be checked manually during {@link #getStateForNeighborUpdate} COMMENT in order to break the block that lost its supporting block. COMMENT COMMENT
This is only checked during {@linkplain net.minecraft.item.BlockItem#canPlace the COMMENT use of block items} or by endermen, falling blocks, etc that can place blocks. This COMMENT does not affect block state changes performed through {@link COMMENT World#setBlockState(BlockPos, BlockState)} call. COMMENT COMMENT
This method is called on both the logical client and logical server, so take caution COMMENT when overriding this method. The logical side can be checked using {@link COMMENT World#isClient}. COMMENT COMMENT @deprecated Consider calling {@link AbstractBlockState#canPlaceAt} instead. See why these methods are deprecated. COMMENT COMMENT @see #getStateForNeighborUpdate ARG 1 state ARG 2 world ARG 3 pos METHOD method_9559 getStateForNeighborUpdate (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; COMMENT {@return the state of the block after a neighboring block's state change} COMMENT COMMENT
Returning {@link Blocks#AIR} breaks the block. This is useful to implement supporting COMMENT block requirement for blocks (if used along with {@link #canPlaceAt}). COMMENT COMMENT
Side effects like activating a redstone component (but not scheduling a tick) COMMENT should be performed in {@link #neighborUpdate} instead. If the block supports COMMENT waterlogging and currently has water, this method should be overridden to tick the COMMENT fluid at the block's position. COMMENT COMMENT
This method is called on both the logical client and logical server, so take caution COMMENT when overriding this method. The logical side can be checked using {@link COMMENT World#isClient}. This is not called if {@link Block#FORCE_STATE} flag is set in the {@code COMMENT setBlockState} call. COMMENT COMMENT
This method can be used for multiple purposes. Here are some examples: COMMENT
The default implementation uses loot tables. Blocks with custom drops should COMMENT not hardcode the drops; instead, make a new loot table. If the loot table COMMENT needs an additional context, override this method and modify {@code builder} before COMMENT calling {@code super.getDroppedStacks}. An example of this is {@link ShulkerBoxBlock}. COMMENT Note that to prevent item duplication, when appending item stacks to the builder, COMMENT {@link ItemStack#split} should be called. COMMENT COMMENT
This method should not be used for dropping inventory contents ({@link COMMENT #onStateReplaced} should be used instead) or to drop experience orbs ({@link COMMENT #onStacksDropped} should be used instead). COMMENT COMMENT @deprecated Consider calling {@link AbstractBlockState#getDroppedStacks} instead. See why these methods are deprecated. COMMENT COMMENT @see #onStateReplaced COMMENT @see #onStacksDropped COMMENT @see ItemStack#split COMMENT @see net.minecraft.loot.context.LootContextParameters ARG 1 state ARG 2 builder METHOD method_9565 onStacksDropped (Lnet/minecraft/class_2680;Lnet/minecraft/class_3218;Lnet/minecraft/class_2338;Lnet/minecraft/class_1799;Z)V COMMENT Called server-side when the stacks are dropped by mining or explosion. This is mostly COMMENT overridden to drop experience orbs. To change the dropped item stacks, use loot tables COMMENT or {@link #getDroppedStacks}. To drop inventory contents, use {@link #onStateReplaced} COMMENT instead. COMMENT COMMENT
Experience orbs should only be dropped if {@code dropExperience} is {@code true}. COMMENT {@link Block#dropExperienceWhenMined} can be used to drop experience orbs. COMMENT {@link ExperienceDroppingBlock} provides the implementation for experience-dropping blocks. COMMENT COMMENT @deprecated Consider calling {@link AbstractBlockState#onStacksDropped} instead. See why these methods are deprecated. COMMENT COMMENT @see ExperienceDroppingBlock COMMENT @see Block#dropExperienceWhenMined COMMENT @see #getDroppedStacks COMMENT @see #onStateReplaced ARG 1 state ARG 2 world ARG 3 pos ARG 4 tool ARG 5 dropExperience METHOD method_9569 mirror (Lnet/minecraft/class_2680;Lnet/minecraft/class_2415;)Lnet/minecraft/class_2680; COMMENT {@return {@code state} mirrored by {@code mirror}} COMMENT COMMENT
By default, this returns the provided block state. COMMENT COMMENT @deprecated Consider calling {@link AbstractBlockState#mirror} instead. See why these methods are deprecated. ARG 1 state ARG 2 mirror METHOD method_9571 getCullingShape (Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;)Lnet/minecraft/class_265; COMMENT @deprecated Consider calling {@link AbstractBlockState#getCullingShape} instead. See why these methods are deprecated. ARG 1 state ARG 2 world ARG 3 pos METHOD method_9572 getComparatorOutput (Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;)I COMMENT {@return the comparator output of the block, from {@code 0} to {@code 15}} COMMENT COMMENT
When overriding this, {@link #hasComparatorOutput} must also be overridden. COMMENT COMMENT @deprecated Consider calling {@link AbstractBlockState#getComparatorOutput} instead. See why these methods are deprecated. COMMENT COMMENT @see #hasComparatorOutput ARG 1 state ARG 2 world ARG 3 pos METHOD method_9575 getAmbientOcclusionLightLevel (Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;)F COMMENT @deprecated Consider calling {@link AbstractBlockState#getAmbientOcclusionLightLevel} instead. See why these methods are deprecated. ARG 1 state ARG 2 world ARG 3 pos METHOD method_9584 getRaycastShape (Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;)Lnet/minecraft/class_265; COMMENT @deprecated Consider calling {@link AbstractBlockState#getRaycastShape} instead. See why these methods are deprecated. ARG 1 state ARG 2 world ARG 3 pos METHOD method_9588 scheduledTick (Lnet/minecraft/class_2680;Lnet/minecraft/class_3218;Lnet/minecraft/class_2338;Lnet/minecraft/class_5819;)V COMMENT Called server-side when a block receives a scheduled tick. This can be used like a timer. COMMENT Scheduled ticks are added using {@link COMMENT WorldAccess#scheduleBlockTick(BlockPos, Block, int)}. Additionally, {@link COMMENT #randomTick} by default calls this method; override {@link #randomTick} to disable this COMMENT behavior. COMMENT COMMENT
Scheduled ticks are often used inside {@link #getStateForNeighborUpdate}. COMMENT COMMENT
Here are some examples: COMMENT
By default, this returns the provided block state. COMMENT COMMENT @deprecated Consider calling {@link AbstractBlockState#rotate} instead. See why these methods are deprecated. ARG 1 state ARG 2 rotation METHOD method_9603 getStrongRedstonePower (Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;Lnet/minecraft/class_2350;)I COMMENT {@return the strong redstone power emitted from the block} COMMENT COMMENT
When overriding this, make sure to also override {@link #emitsRedstonePower} to COMMENT return {@code true}. {@link #getWeakRedstonePower} might also need to be overridden. COMMENT COMMENT
Strong redstone power is a power that can power a redstone wire when a solid block COMMENT is in between. For example, {@link RedstoneBlock} and {@link TargetBlock} emits weak COMMENT redstone power only. {@link LeverBlock} and {@link ButtonBlock} emits both COMMENT weak and strong redstone power. COMMENT COMMENT @deprecated Consider calling {@link AbstractBlockState#getStrongRedstonePower} instead. See why these methods are deprecated. COMMENT COMMENT @see #emitsRedstonePower COMMENT @see #getWeakRedstonePower COMMENT @see net.minecraft.world.RedstoneView#isReceivingRedstonePower ARG 1 state ARG 2 world ARG 3 pos ARG 4 direction METHOD method_9604 getRenderType (Lnet/minecraft/class_2680;)Lnet/minecraft/class_2464; COMMENT {@return the block's render type (invisible, animated, model)} COMMENT COMMENT @apiNote {@link BlockWithEntity} overrides this to return {@link BlockRenderType#INVISIBLE}; COMMENT therefore, custom blocks extending that class must override it again to render the block. COMMENT COMMENT @deprecated Consider calling {@link AbstractBlockState#getRenderType} instead. See why these methods are deprecated. ARG 1 state METHOD method_9606 onBlockBreakStart (Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1657;)V COMMENT Called when a player starts breaking the block (including when instant-mining). COMMENT COMMENT
This method is called on both the logical client and logical server, so take caution COMMENT when overriding this method. The logical side can be checked using {@link COMMENT World#isClient}. COMMENT COMMENT @deprecated Consider calling {@link AbstractBlockState#onBlockBreakStart} instead. See why these methods are deprecated. ARG 1 state ARG 2 world ARG 3 pos ARG 4 player METHOD method_9612 neighborUpdate (Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2248;Lnet/minecraft/class_2338;Z)V COMMENT Called when a neighboring block is updated. This method should be overridden COMMENT to perform an action with a side effect, most notably an activation of a redstone COMMENT component. This can also be used to perform an action changing block states of COMMENT other blocks, such as {@link SpongeBlock} which absorbs water. COMMENT COMMENT
To replace the state of the block itself, override {@link #getStateForNeighborUpdate} COMMENT instead. COMMENT COMMENT
This method is called on both the logical client and logical server, so take caution COMMENT when overriding this method. The logical side can be checked using {@link COMMENT World#isClient}. COMMENT COMMENT @deprecated Consider calling {@link AbstractBlockState#neighborUpdate} instead. See why these methods are deprecated. COMMENT COMMENT @see #getStateForNeighborUpdate COMMENT @see net.minecraft.world.RedstoneView#isReceivingRedstonePower ARG 1 state ARG 2 world ARG 3 pos ARG 4 sourceBlock ARG 5 sourcePos ARG 6 notify METHOD method_9615 onBlockAdded (Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Z)V COMMENT Called server-side on the new block when the block state is changed. This includes block COMMENT placement. When overriding this method, {@link #getStateForNeighborUpdate} or {@link COMMENT #neighborUpdate} should also be overridden. The method is used in the following cases: COMMENT COMMENT
By default, this checks if the block allows replacing and whether the COMMENT item differs from the block's item. Items composed of multiple blocks, such as candles, COMMENT vines, or snow layers, should override this to implement additional checks. COMMENT COMMENT
This method is called on both the logical client and logical server, so take caution COMMENT when overriding this method. The logical side can be checked using {@link COMMENT World#isClient}. COMMENT COMMENT @deprecated Consider calling {@link AbstractBlockState#canReplace} instead. See why these methods are deprecated. COMMENT COMMENT @see #canBucketPlace COMMENT @see AbstractBlockState#isReplaceable ARG 1 state ARG 2 context CLASS class_2250 OffsetType CLASS class_2251 Settings FIELD field_10660 resistance F FIELD field_10661 randomTicks Z FIELD field_10662 mapColorProvider Ljava/util/function/Function; FIELD field_10663 luminance Ljava/util/function/ToIntFunction; FIELD field_10664 collidable Z FIELD field_10665 soundGroup Lnet/minecraft/class_2498; FIELD field_10666 lootTableId Lnet/minecraft/class_2960; FIELD field_10667 slipperiness F FIELD field_10669 hardness F FIELD field_10670 dynamicBounds Z FIELD field_20721 opaque Z FIELD field_21209 jumpVelocityMultiplier F FIELD field_23179 velocityMultiplier F FIELD field_23180 isAir Z FIELD field_23181 allowsSpawningPredicate Lnet/minecraft/class_4970$class_4972; FIELD field_23182 solidBlockPredicate Lnet/minecraft/class_4970$class_4973; FIELD field_23183 suffocationPredicate Lnet/minecraft/class_4970$class_4973; FIELD field_23184 blockVisionPredicate Lnet/minecraft/class_4970$class_4973; FIELD field_23185 postProcessPredicate Lnet/minecraft/class_4970$class_4973; FIELD field_23186 emissiveLightingPredicate Lnet/minecraft/class_4970$class_4973; FIELD field_25185 toolRequired Z FIELD field_40341 blockBreakParticles Z FIELD field_40342 requiredFeatures Lnet/minecraft/class_7699; FIELD field_42818 offsetter Ljava/util/Optional; FIELD field_43394 burnable Z FIELD field_43395 pistonBehavior Lnet/minecraft/class_3619; FIELD field_44481 liquid Z FIELD field_44627 forceNotSolid Z FIELD field_44628 forceSolid Z FIELD field_44629 instrument Lnet/minecraft/class_2766; FIELD field_44630 replaceable Z METHOD method_16228 dropsLike (Lnet/minecraft/class_2248;)Lnet/minecraft/class_4970$class_2251; COMMENT Specifies that a block should drop the same items as a provided block. ARG 1 source COMMENT the block to copy item drops from METHOD method_22488 nonOpaque ()Lnet/minecraft/class_4970$class_2251; COMMENT Specifies that a block should be non-opaque and light should be allowed to pass through. METHOD method_23351 velocityMultiplier (F)Lnet/minecraft/class_4970$class_2251; ARG 1 velocityMultiplier METHOD method_23352 jumpVelocityMultiplier (F)Lnet/minecraft/class_4970$class_2251; ARG 1 jumpVelocityMultiplier METHOD method_26235 allowsSpawning (Lnet/minecraft/class_4970$class_4972;)Lnet/minecraft/class_4970$class_2251; COMMENT Specifies logic that calculates whether an entity can spawn on a block. ARG 1 predicate COMMENT the predicate used to calculate whether an entity can spawn on this block METHOD method_26236 solidBlock (Lnet/minecraft/class_4970$class_4973;)Lnet/minecraft/class_4970$class_2251; ARG 1 predicate METHOD method_26237 (Lnet/minecraft/class_2680;)I ARG 0 state METHOD method_26238 (Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;)Z ARG 0 state ARG 1 world ARG 2 pos METHOD method_26239 (Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;Lnet/minecraft/class_1299;)Z ARG 0 state ARG 1 world ARG 2 pos ARG 3 type METHOD method_26243 suffocates (Lnet/minecraft/class_4970$class_4973;)Lnet/minecraft/class_4970$class_2251; COMMENT Specifies logic that calculates whether an entity should suffocate if inside of a block. ARG 1 predicate METHOD method_26244 (Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;)Z ARG 0 state ARG 1 world ARG 2 pos METHOD method_26245 blockVision (Lnet/minecraft/class_4970$class_4973;)Lnet/minecraft/class_4970$class_2251; ARG 1 predicate METHOD method_26246 (Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;)Z ARG 0 state ARG 1 world ARG 2 pos METHOD method_26247 postProcess (Lnet/minecraft/class_4970$class_4973;)Lnet/minecraft/class_4970$class_2251; ARG 1 predicate METHOD method_26248 (Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;)Z ARG 0 state ARG 1 world ARG 2 pos METHOD method_26249 emissiveLighting (Lnet/minecraft/class_4970$class_4973;)Lnet/minecraft/class_4970$class_2251; ARG 1 predicate METHOD method_26250 air ()Lnet/minecraft/class_4970$class_2251; METHOD method_29292 requiresTool ()Lnet/minecraft/class_4970$class_2251; METHOD method_31710 mapColor (Lnet/minecraft/class_3620;)Lnet/minecraft/class_4970$class_2251; ARG 1 color METHOD method_36557 hardness (F)Lnet/minecraft/class_4970$class_2251; ARG 1 hardness METHOD method_36558 resistance (F)Lnet/minecraft/class_4970$class_2251; ARG 1 resistance METHOD method_42327 dropsNothing ()Lnet/minecraft/class_4970$class_2251; METHOD method_45476 requires ([Lnet/minecraft/class_7696;)Lnet/minecraft/class_4970$class_2251; ARG 1 features METHOD method_45477 noBlockBreakParticles ()Lnet/minecraft/class_4970$class_2251; METHOD method_49229 offset (Lnet/minecraft/class_4970$class_2250;)Lnet/minecraft/class_4970$class_2251; ARG 1 offsetType METHOD method_49230 (Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;)Lnet/minecraft/class_243; ARG 0 state ARG 1 world ARG 2 pos METHOD method_49231 (Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;)Lnet/minecraft/class_243; ARG 0 state ARG 1 world ARG 2 pos METHOD method_50012 pistonBehavior (Lnet/minecraft/class_3619;)Lnet/minecraft/class_4970$class_2251; ARG 1 pistonBehavior METHOD method_50013 burnable ()Lnet/minecraft/class_4970$class_2251; METHOD method_51177 liquid ()Lnet/minecraft/class_4970$class_2251; METHOD method_51368 instrument (Lnet/minecraft/class_2766;)Lnet/minecraft/class_4970$class_2251; ARG 1 instrument METHOD method_51369 solid ()Lnet/minecraft/class_4970$class_2251; METHOD method_51370 notSolid ()Lnet/minecraft/class_4970$class_2251; METHOD method_51371 replaceable ()Lnet/minecraft/class_4970$class_2251; METHOD method_51517 mapColor (Lnet/minecraft/class_1767;)Lnet/minecraft/class_4970$class_2251; ARG 1 color METHOD method_51518 (Lnet/minecraft/class_1767;Lnet/minecraft/class_2680;)Lnet/minecraft/class_3620; ARG 1 state METHOD method_51519 (Lnet/minecraft/class_3620;Lnet/minecraft/class_2680;)Lnet/minecraft/class_3620; ARG 1 state METHOD method_51520 mapColor (Ljava/util/function/Function;)Lnet/minecraft/class_4970$class_2251; ARG 1 mapColorProvider METHOD method_51521 (Lnet/minecraft/class_2680;)Lnet/minecraft/class_3620; ARG 0 state METHOD method_9618 breakInstantly ()Lnet/minecraft/class_4970$class_2251; COMMENT Specifies that a block is broken instantly. METHOD method_9624 dynamicBounds ()Lnet/minecraft/class_4970$class_2251; COMMENT Specifies that a block's collision bounds can dynamically resize. COMMENT By default, block collision bounds are cached for performance. COMMENT By invoking this method, the game will not cache the block collision bounds and instead calculate the collision bounds when needed. METHOD method_9626 sounds (Lnet/minecraft/class_2498;)Lnet/minecraft/class_4970$class_2251; ARG 1 soundGroup METHOD method_9628 slipperiness (F)Lnet/minecraft/class_4970$class_2251; ARG 1 slipperiness METHOD method_9629 strength (FF)Lnet/minecraft/class_4970$class_2251; ARG 1 hardness ARG 2 resistance METHOD method_9630 copy (Lnet/minecraft/class_4970;)Lnet/minecraft/class_4970$class_2251; ARG 0 block METHOD method_9631 luminance (Ljava/util/function/ToIntFunction;)Lnet/minecraft/class_4970$class_2251; COMMENT Specifies the light level emitted by a block. ARG 1 luminance COMMENT a per block state light level, with values between 0 and 15 METHOD method_9632 strength (F)Lnet/minecraft/class_4970$class_2251; ARG 1 strength METHOD method_9634 noCollision ()Lnet/minecraft/class_4970$class_2251; COMMENT Specifies that a block should have no collision bounds. COMMENT COMMENT
This also marks a block as non-opaque.
METHOD method_9637 create ()Lnet/minecraft/class_4970$class_2251;
METHOD method_9640 ticksRandomly ()Lnet/minecraft/class_4970$class_2251;
CLASS class_4971 AbstractBlockState
FIELD field_23166 shapeCache Lnet/minecraft/class_4970$class_4971$class_3752;
FIELD field_23167 luminance I
FIELD field_23168 hasSidedTransparency Z
FIELD field_23169 isAir Z
FIELD field_23171 mapColor Lnet/minecraft/class_3620;
FIELD field_23172 hardness F
FIELD field_23173 opaque Z
FIELD field_23174 solidBlockPredicate Lnet/minecraft/class_4970$class_4973;
FIELD field_23175 suffocationPredicate Lnet/minecraft/class_4970$class_4973;
FIELD field_23176 blockVisionPredicate Lnet/minecraft/class_4970$class_4973;
FIELD field_23177 postProcessPredicate Lnet/minecraft/class_4970$class_4973;
FIELD field_23178 emissiveLightingPredicate Lnet/minecraft/class_4970$class_4973;
FIELD field_25184 toolRequired Z
FIELD field_40338 blockBreakParticles Z
FIELD field_40339 fluidState Lnet/minecraft/class_3610;
FIELD field_40340 ticksRandomly Z
FIELD field_42817 offsetter Ljava/util/Optional;
FIELD field_43392 burnable Z
FIELD field_43393 pistonBehavior Lnet/minecraft/class_3619;
FIELD field_44480 liquid Z
FIELD field_44624 solid Z
FIELD field_44625 instrument Lnet/minecraft/class_2766;
FIELD field_44626 replaceable Z
METHOD