Class BrushableBlock
- All Implemented Interfaces:
BlockEntityProvider
,LandingBlock
,ItemConvertible
,ToggleableFeature
- Mappings:
Namespace Name named net/minecraft/block/BrushableBlock
intermediary net/minecraft/class_8170
official dfn
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.block.Block
Block.NeighborGroup
Nested classes/interfaces inherited from class net.minecraft.block.AbstractBlock
AbstractBlock.AbstractBlockState, AbstractBlock.ContextPredicate, AbstractBlock.Offsetter, AbstractBlock.OffsetType, AbstractBlock.Settings, AbstractBlock.TypedContextPredicate<A>
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Block
private final SoundEvent
private final SoundEvent
static final com.mojang.serialization.MapCodec
<BrushableBlock> private static final IntProperty
static final int
Fields inherited from class net.minecraft.block.Block
field_31023, field_31024, field_31025, field_31035, FORCE_STATE, MOVED, NO_REDRAW, NOTIFY_ALL, NOTIFY_ALL_AND_REDRAW, NOTIFY_LISTENERS, NOTIFY_NEIGHBORS, REDRAW_ON_MAIN_THREAD, SKIP_DROPS, STATE_IDS, stateManager
Fields inherited from class net.minecraft.block.AbstractBlock
collidable, DIRECTIONS, dynamicBounds, jumpVelocityMultiplier, lootTableKey, randomTicks, requiredFeatures, resistance, settings, slipperiness, soundGroup, velocityMultiplier
Fields inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeature
FEATURE_ENABLED_REGISTRY_KEYS
-
Constructor Summary
ConstructorDescriptionBrushableBlock
(Block baseBlock, SoundEvent brushingSound, SoundEvent brushingCompleteSound, AbstractBlock.Settings settings) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
appendProperties
(StateManager.Builder<Block, BlockState> builder) Appends block state properties to this block.createBlockEntity
(BlockPos pos, BlockState state) Returns a new block entity instance.com.mojang.serialization.MapCodec
<BrushableBlock> getCodec()
getRenderType
(BlockState state) Returns the block's render type (invisible, animated, model).getStateForNeighborUpdate
(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) Returns the state of the block after a neighboring block's state change.void
onBlockAdded
(BlockState state, World world, BlockPos pos, BlockState oldState, boolean notify) Called server-side on the new block when the block state is changed.void
onDestroyedOnLanding
(World world, BlockPos pos, FallingBlockEntity fallingBlockEntity) void
randomDisplayTick
(BlockState state, World world, BlockPos pos, Random random) Called randomly on the client.void
scheduledTick
(BlockState state, ServerWorld world, BlockPos pos, Random random) Called server-side when a block receives a scheduled tick.Methods inherited from class net.minecraft.block.BlockWithEntity
createScreenHandlerFactory, onSyncedBlockEvent, validateTicker
Methods inherited from class net.minecraft.block.Block
afterBreak, appendTooltip, asBlock, asItem, canMobSpawnInside, cannotConnect, createCuboidShape, dropExperience, dropExperienceWhenMined, dropStack, dropStack, dropStacks, dropStacks, dropStacks, getBlastResistance, getBlockFromItem, getDefaultState, getDroppedStacks, getDroppedStacks, getJumpVelocityMultiplier, getName, getPickStack, getPlacementState, getRawIdFromState, getRegistryEntry, getShapesForStates, getSlipperiness, getStateFromRawId, getStateManager, getStateWithProperties, getTranslationKey, getVelocityMultiplier, hasDynamicBounds, hasTopRim, isFaceFullSquare, isShapeFullCube, onBreak, onBroken, onDestroyedByExplosion, onEntityLand, onLandedUpon, onPlaced, onSteppedOn, postProcessState, precipitationTick, pushEntitiesUpBeforeBlockChange, replace, replace, setDefaultState, shouldDrawSide, shouldDropItemsOnExplosion, sideCoversSmallSquare, spawnBreakParticles, toString
Methods inherited from class net.minecraft.block.AbstractBlock
calcBlockBreakingDelta, canBucketPlace, canPathfindThrough, canPlaceAt, canReplace, createCodec, createSettingsCodec, emitsRedstonePower, getAmbientOcclusionLightLevel, getCameraCollisionShape, getCollisionShape, getComparatorOutput, getCullingShape, getDefaultMapColor, getDroppedStacks, getFluidState, getHardness, getLootTableKey, getMaxHorizontalModelOffset, getOpacity, getOutlineShape, getRaycastShape, getRenderingSeed, getRequiredFeatures, getSettings, getSidesShape, getSoundGroup, getStrongRedstonePower, getVerticalModelOffsetMultiplier, getWeakRedstonePower, hasComparatorOutput, hasRandomTicks, hasSidedTransparency, isCullingShapeFullCube, isShapeFullCube, isSideInvisible, isTransparent, mirror, neighborUpdate, onBlockBreakStart, onEntityCollision, onExploded, onProjectileHit, onStacksDropped, onStateReplaced, onUse, onUseWithItem, prepare, randomTick, rotate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.block.BlockEntityProvider
getGameEventListener, getTicker
Methods inherited from interface net.minecraft.block.LandingBlock
getDamageSource, onLanding
Methods inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeature
isEnabled
-
Field Details
-
CODEC
- Mappings:
Namespace Name Mixin selector named CODEC
Lnet/minecraft/block/BrushableBlock;CODEC:Lcom/mojang/serialization/MapCodec;
intermediary field_46290
Lnet/minecraft/class_8170;field_46290:Lcom/mojang/serialization/MapCodec;
official a
Ldfn;a:Lcom/mojang/serialization/MapCodec;
-
DUSTED
- Mappings:
Namespace Name Mixin selector named DUSTED
Lnet/minecraft/block/BrushableBlock;DUSTED:Lnet/minecraft/state/property/IntProperty;
intermediary field_42774
Lnet/minecraft/class_8170;field_42774:Lnet/minecraft/class_2758;
official c
Ldfn;c:Ldtl;
-
field_42773
public static final int field_42773- See Also:
- Mappings:
Namespace Name Mixin selector named field_42773
Lnet/minecraft/block/BrushableBlock;field_42773:I
intermediary field_42773
Lnet/minecraft/class_8170;field_42773:I
official b
Ldfn;b:I
-
baseBlock
- Mappings:
Namespace Name Mixin selector named baseBlock
Lnet/minecraft/block/BrushableBlock;baseBlock:Lnet/minecraft/block/Block;
intermediary field_43232
Lnet/minecraft/class_8170;field_43232:Lnet/minecraft/class_2248;
official d
Ldfn;d:Ldfi;
-
brushingSound
- Mappings:
Namespace Name Mixin selector named brushingSound
Lnet/minecraft/block/BrushableBlock;brushingSound:Lnet/minecraft/sound/SoundEvent;
intermediary field_43233
Lnet/minecraft/class_8170;field_43233:Lnet/minecraft/class_3414;
official e
Ldfn;e:Lavg;
-
brushingCompleteSound
- Mappings:
Namespace Name Mixin selector named brushingCompleteSound
Lnet/minecraft/block/BrushableBlock;brushingCompleteSound:Lnet/minecraft/sound/SoundEvent;
intermediary field_43234
Lnet/minecraft/class_8170;field_43234:Lnet/minecraft/class_3414;
official f
Ldfn;f:Lavg;
-
-
Constructor Details
-
BrushableBlock
public BrushableBlock(Block baseBlock, SoundEvent brushingSound, SoundEvent brushingCompleteSound, AbstractBlock.Settings settings) - Mappings:
Namespace Name Mixin selector named <init>
Lnet/minecraft/block/BrushableBlock;<init>(Lnet/minecraft/block/Block;Lnet/minecraft/sound/SoundEvent;Lnet/minecraft/sound/SoundEvent;Lnet/minecraft/block/AbstractBlock$Settings;)V
intermediary <init>
Lnet/minecraft/class_8170;<init>(Lnet/minecraft/class_2248;Lnet/minecraft/class_3414;Lnet/minecraft/class_3414;Lnet/minecraft/class_4970$class_2251;)V
official <init>
Ldfn;<init>(Ldfi;Lavg;Lavg;Ldsk$d;)V
-
-
Method Details
-
getCodec
- Specified by:
getCodec
in classBlockWithEntity
- Mappings:
Namespace Name Mixin selector named getCodec
Lnet/minecraft/block/AbstractBlock;getCodec()Lcom/mojang/serialization/MapCodec;
intermediary method_53969
Lnet/minecraft/class_4970;method_53969()Lcom/mojang/serialization/MapCodec;
official a
Ldsk;a()Lcom/mojang/serialization/MapCodec;
-
appendProperties
Appends block state properties to this block. To use this, override and callStateManager.Builder.add(net.minecraft.state.property.Property<?>[])
inside the method. SeeProperties
for the list of pre-defined properties.- Overrides:
appendProperties
in classBlock
- Mappings:
Namespace Name Mixin selector named appendProperties
Lnet/minecraft/block/Block;appendProperties(Lnet/minecraft/state/StateManager$Builder;)V
intermediary method_9515
Lnet/minecraft/class_2248;method_9515(Lnet/minecraft/class_2689$class_2690;)V
official a
Ldfi;a(Ldsm$a;)V
-
getRenderType
Returns the block's render type (invisible, animated, model).- Overrides:
getRenderType
in classBlockWithEntity
- Returns:
- the block's render type (invisible, animated, model)
- See Also:
- API Note:
BlockWithEntity
overrides this to returnBlockRenderType.INVISIBLE
; therefore, custom blocks extending that class must override it again to render the block.- Mappings:
Namespace Name Mixin selector named getRenderType
Lnet/minecraft/block/AbstractBlock;getRenderType(Lnet/minecraft/block/BlockState;)Lnet/minecraft/block/BlockRenderType;
intermediary method_9604
Lnet/minecraft/class_4970;method_9604(Lnet/minecraft/class_2680;)Lnet/minecraft/class_2464;
official a_
Ldsk;a_(Ldsl;)Ldlo;
-
onBlockAdded
public void onBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean notify) 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)
orAbstractBlock.neighborUpdate(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
AbstractBlock.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
- Overrides:
onBlockAdded
in classAbstractBlock
- See Also:
- Mappings:
Namespace Name Mixin selector named onBlockAdded
Lnet/minecraft/block/AbstractBlock;onBlockAdded(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Z)V
intermediary method_9615
Lnet/minecraft/class_4970;method_9615(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Z)V
official b
Ldsk;b(Ldsl;Ldcg;Lja;Ldsl;Z)V
- When activating a redstone component on placement (used along with
-
getStateForNeighborUpdate
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) Returns the state of the block after a neighboring block's state change.Returning
Blocks.AIR
breaks the block. This is useful to implement supporting block requirement for blocks (if used along withAbstractBlock.canPlaceAt(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
AbstractBlock.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_STATE
flag is set in thesetBlockState
call.This method can be used for multiple purposes. Here are some examples:
FenceBlock
uses it to update the fence's connection when a horizontally neighboring block's state is changed.PlantBlock
uses it to break the plant if the state change causes it to lose its supporting block.DoorBlock
uses it to copy the state of the other half of the door.SlabBlock
uses it to schedule the fluid to tick if waterlogged.SoulSandBlock
uses it to schedule the water block above to tick so that it becomes a bubble column.FallingBlock
uses it to schedule the block to tick so that it can fall if needed.
- Overrides:
getStateForNeighborUpdate
in classAbstractBlock
- 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 named getStateForNeighborUpdate
Lnet/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;
intermediary method_9559
Lnet/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;
official a
Ldsk;a(Ldsl;Ljf;Ldsl;Ldch;Lja;Lja;)Ldsl;
-
scheduledTick
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)
.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:
SugarCaneBlock
checks the placement requirement.DispenserBlock
dispenses its content.CommandBlock
executes its command.FrogspawnBlock
spawns a tadpole.SoulSandBlock
updates a bubble column.FallingBlock
tries to fall.
- Overrides:
scheduledTick
in classAbstractBlock
- See Also:
- Mappings:
Namespace Name Mixin selector named scheduledTick
Lnet/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
intermediary method_9588
Lnet/minecraft/class_4970;method_9588(Lnet/minecraft/class_2680;Lnet/minecraft/class_3218;Lnet/minecraft/class_2338;Lnet/minecraft/class_5819;)V
official a
Ldsk;a(Ldsl;Laqm;Lja;Layo;)V
-
onDestroyedOnLanding
- Specified by:
onDestroyedOnLanding
in interfaceLandingBlock
- Mappings:
Namespace Name Mixin selector named onDestroyedOnLanding
Lnet/minecraft/block/LandingBlock;onDestroyedOnLanding(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/FallingBlockEntity;)V
intermediary method_10129
Lnet/minecraft/class_5688;method_10129(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1540;)V
official a
Ldid;a(Ldcg;Lja;Lciu;)V
-
randomDisplayTick
Called randomly on the client. Blocks may override this to spawn particles. UnlikeAbstractBlock.randomTick(net.minecraft.block.BlockState, net.minecraft.server.world.ServerWorld, net.minecraft.util.math.BlockPos, net.minecraft.util.math.random.Random)
this is not affected by a game rule.- Overrides:
randomDisplayTick
in classBlock
- Mappings:
Namespace Name Mixin selector named randomDisplayTick
Lnet/minecraft/block/Block;randomDisplayTick(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/random/Random;)V
intermediary method_9496
Lnet/minecraft/class_2248;method_9496(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_5819;)V
official a
Ldfi;a(Ldsl;Ldcg;Lja;Layo;)V
-
createBlockEntity
Returns a new block entity instance.For example:
@Override public BlockEntity createBlockEntity(BlockPos pos, BlockState state) { return new MyBlockEntity(pos, state); }
- Specified by:
createBlockEntity
in interfaceBlockEntityProvider
- Returns:
- a new block entity instance
- Implementation Note:
- While this is marked as nullable, in practice this should never return
null
.PistonExtensionBlock
is the only block in vanilla that returnsnull
inside the implementation. - Mappings:
Namespace Name Mixin selector named createBlockEntity
Lnet/minecraft/block/BlockEntityProvider;createBlockEntity(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Lnet/minecraft/block/entity/BlockEntity;
intermediary method_10123
Lnet/minecraft/class_2343;method_10123(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Lnet/minecraft/class_2586;
official a
Ldia;a(Lja;Ldsl;)Ldpq;
-
getBaseBlock
- Mappings:
Namespace Name Mixin selector named getBaseBlock
Lnet/minecraft/block/BrushableBlock;getBaseBlock()Lnet/minecraft/block/Block;
intermediary method_49810
Lnet/minecraft/class_8170;method_49810()Lnet/minecraft/class_2248;
official b
Ldfn;b()Ldfi;
-
getBrushingSound
- Mappings:
Namespace Name Mixin selector named getBrushingSound
Lnet/minecraft/block/BrushableBlock;getBrushingSound()Lnet/minecraft/sound/SoundEvent;
intermediary method_49811
Lnet/minecraft/class_8170;method_49811()Lnet/minecraft/class_3414;
official c
Ldfn;c()Lavg;
-
getBrushingCompleteSound
- Mappings:
Namespace Name Mixin selector named getBrushingCompleteSound
Lnet/minecraft/block/BrushableBlock;getBrushingCompleteSound()Lnet/minecraft/sound/SoundEvent;
intermediary method_49812
Lnet/minecraft/class_8170;method_49812()Lnet/minecraft/class_3414;
official d
Ldfn;d()Lavg;
-