Class ButtonBlock
- All Implemented Interfaces:
ItemConvertible,ToggleableFeature
- Mappings:
Namespace Name named net/minecraft/block/ButtonBlockintermediary net/minecraft/class_2269official dgi
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.block.Block
Block.NeighborGroupNested classes/interfaces inherited from class net.minecraft.block.AbstractBlock
AbstractBlock.AbstractBlockState, AbstractBlock.ContextPredicate, AbstractBlock.Offsetter, AbstractBlock.OffsetType, AbstractBlock.Settings, AbstractBlock.TypedContextPredicate<A> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BlockSetTypeprotected static final VoxelShapeprotected static final VoxelShapeprotected static final VoxelShapeprotected static final VoxelShapestatic final com.mojang.serialization.MapCodec<ButtonBlock> protected static final VoxelShapeprotected static final VoxelShapeprivate static final intprivate static final intprotected static final intprotected static final intprotected static final VoxelShapeprotected static final VoxelShapeprotected static final VoxelShapeprotected static final VoxelShapeprotected static final VoxelShapeprotected static final VoxelShapestatic final BooleanPropertyprivate final intprotected static final VoxelShapeprotected static final VoxelShapeprotected static final VoxelShapeprotected static final VoxelShapeFields inherited from class net.minecraft.block.WallMountedBlock
FACEFields inherited from class net.minecraft.block.HorizontalFacingBlock
FACINGFields 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, stateManagerFields inherited from class net.minecraft.block.AbstractBlock
collidable, DIRECTIONS, dynamicBounds, jumpVelocityMultiplier, lootTableKey, randomTicks, requiredFeatures, resistance, settings, slipperiness, soundGroup, velocityMultiplierFields inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeature
FEATURE_ENABLED_REGISTRY_KEYS -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedButtonBlock(BlockSetType blockSetType, int pressTicks, AbstractBlock.Settings settings) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidappendProperties(StateManager.Builder<Block, BlockState> builder) Appends block state properties to this block.protected booleanemitsRedstonePower(BlockState state) Returns whether the block is capable of emitting redstone power.protected SoundEventgetClickSound(boolean powered) com.mojang.serialization.MapCodec<ButtonBlock> getCodec()protected VoxelShapegetOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) protected intgetStrongRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction) Returns the strong redstone power emitted from the block.protected intgetWeakRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction) Returns the weak redstone power emitted from the block.protected voidonEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) Called when the entity's collision box intersects the block.protected voidonExploded(BlockState state, World world, BlockPos pos, Explosion explosion, BiConsumer<ItemStack, BlockPos> stackMerger) protected voidonStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) Called server-side on the old block when the block state is changed.protected ActionResultonUse(BlockState state, World world, BlockPos pos, PlayerEntity player, BlockHitResult hit) protected voidplayClickSound(@Nullable PlayerEntity player, WorldAccess world, BlockPos pos, boolean powered) voidpowerOn(BlockState state, World world, BlockPos pos, @Nullable PlayerEntity player) protected voidscheduledTick(BlockState state, ServerWorld world, BlockPos pos, Random random) Called server-side when a block receives a scheduled tick.protected voidtryPowerWithProjectiles(BlockState state, World world, BlockPos pos) private voidupdateNeighbors(BlockState state, World world, BlockPos pos) Methods inherited from class net.minecraft.block.WallMountedBlock
canPlaceAt, canPlaceAt, getDirection, getPlacementState, getStateForNeighborUpdateMethods inherited from class net.minecraft.block.HorizontalFacingBlock
mirror, rotateMethods 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, getRawIdFromState, getRegistryEntry, getShapesForStates, getSlipperiness, getStateFromRawId, getStateManager, getStateWithProperties, getTranslationKey, getVelocityMultiplier, hasDynamicBounds, hasTopRim, isFaceFullSquare, isShapeFullCube, onBreak, onBroken, onDestroyedByExplosion, onEntityLand, onLandedUpon, onPlaced, onSteppedOn, postProcessState, precipitationTick, pushEntitiesUpBeforeBlockChange, randomDisplayTick, replace, replace, setDefaultState, shouldDrawSide, shouldDropItemsOnExplosion, sideCoversSmallSquare, spawnBreakParticles, toStringMethods inherited from class net.minecraft.block.AbstractBlock
calcBlockBreakingDelta, canBucketPlace, canPathfindThrough, canReplace, createCodec, createScreenHandlerFactory, createSettingsCodec, getAmbientOcclusionLightLevel, getCameraCollisionShape, getCollisionShape, getComparatorOutput, getCullingShape, getDefaultMapColor, getDroppedStacks, getFluidState, getHardness, getLootTableKey, getMaxHorizontalModelOffset, getOpacity, getRaycastShape, getRenderingSeed, getRenderType, getRequiredFeatures, getSettings, getSidesShape, getSoundGroup, getVerticalModelOffsetMultiplier, hasComparatorOutput, hasRandomTicks, hasSidedTransparency, isCullingShapeFullCube, isShapeFullCube, isSideInvisible, isTransparent, neighborUpdate, onBlockAdded, onBlockBreakStart, onProjectileHit, onStacksDropped, onSyncedBlockEvent, onUseWithItem, prepare, randomTickMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeature
isEnabled
-
Field Details
-
CODEC
- Mappings:
Namespace Name Mixin selector named CODECLnet/minecraft/block/ButtonBlock;CODEC:Lcom/mojang/serialization/MapCodec;intermediary field_46293Lnet/minecraft/class_2269;field_46293:Lcom/mojang/serialization/MapCodec;official aLdgi;a:Lcom/mojang/serialization/MapCodec;
-
POWERED
- Mappings:
Namespace Name Mixin selector named POWEREDLnet/minecraft/block/ButtonBlock;POWERED:Lnet/minecraft/state/property/BooleanProperty;intermediary field_10729Lnet/minecraft/class_2269;field_10729:Lnet/minecraft/class_2746;official bLdgi;b:Ldtt;
-
field_31040
private static final int field_31040- See Also:
- Mappings:
Namespace Name Mixin selector named field_31040Lnet/minecraft/block/ButtonBlock;field_31040:Iintermediary field_31040Lnet/minecraft/class_2269;field_31040:Iofficial LLdgi;L:I
-
field_31041
private static final int field_31041- See Also:
- Mappings:
Namespace Name Mixin selector named field_31041Lnet/minecraft/block/ButtonBlock;field_31041:Iintermediary field_31041Lnet/minecraft/class_2269;field_31041:Iofficial MLdgi;M:I
-
field_31042
protected static final int field_31042- See Also:
- Mappings:
Namespace Name Mixin selector named field_31042Lnet/minecraft/block/ButtonBlock;field_31042:Iintermediary field_31042Lnet/minecraft/class_2269;field_31042:Iofficial cLdgi;c:I
-
field_31043
protected static final int field_31043- See Also:
- Mappings:
Namespace Name Mixin selector named field_31043Lnet/minecraft/block/ButtonBlock;field_31043:Iintermediary field_31043Lnet/minecraft/class_2269;field_31043:Iofficial dLdgi;d:I
-
CEILING_X_SHAPE
- Mappings:
Namespace Name Mixin selector named CEILING_X_SHAPELnet/minecraft/block/ButtonBlock;CEILING_X_SHAPE:Lnet/minecraft/util/shape/VoxelShape;intermediary field_10721Lnet/minecraft/class_2269;field_10721:Lnet/minecraft/class_265;official eLdgi;e:Lexv;
-
CEILING_Z_SHAPE
- Mappings:
Namespace Name Mixin selector named CEILING_Z_SHAPELnet/minecraft/block/ButtonBlock;CEILING_Z_SHAPE:Lnet/minecraft/util/shape/VoxelShape;intermediary field_10727Lnet/minecraft/class_2269;field_10727:Lnet/minecraft/class_265;official fLdgi;f:Lexv;
-
FLOOR_X_SHAPE
- Mappings:
Namespace Name Mixin selector named FLOOR_X_SHAPELnet/minecraft/block/ButtonBlock;FLOOR_X_SHAPE:Lnet/minecraft/util/shape/VoxelShape;intermediary field_10723Lnet/minecraft/class_2269;field_10723:Lnet/minecraft/class_265;official gLdgi;g:Lexv;
-
FLOOR_Z_SHAPE
- Mappings:
Namespace Name Mixin selector named FLOOR_Z_SHAPELnet/minecraft/block/ButtonBlock;FLOOR_Z_SHAPE:Lnet/minecraft/util/shape/VoxelShape;intermediary field_10716Lnet/minecraft/class_2269;field_10716:Lnet/minecraft/class_265;official hLdgi;h:Lexv;
-
NORTH_SHAPE
- Mappings:
Namespace Name Mixin selector named NORTH_SHAPELnet/minecraft/block/ButtonBlock;NORTH_SHAPE:Lnet/minecraft/util/shape/VoxelShape;intermediary field_10728Lnet/minecraft/class_2269;field_10728:Lnet/minecraft/class_265;official iLdgi;i:Lexv;
-
SOUTH_SHAPE
- Mappings:
Namespace Name Mixin selector named SOUTH_SHAPELnet/minecraft/block/ButtonBlock;SOUTH_SHAPE:Lnet/minecraft/util/shape/VoxelShape;intermediary field_10715Lnet/minecraft/class_2269;field_10715:Lnet/minecraft/class_265;official jLdgi;j:Lexv;
-
WEST_SHAPE
- Mappings:
Namespace Name Mixin selector named WEST_SHAPELnet/minecraft/block/ButtonBlock;WEST_SHAPE:Lnet/minecraft/util/shape/VoxelShape;intermediary field_10731Lnet/minecraft/class_2269;field_10731:Lnet/minecraft/class_265;official kLdgi;k:Lexv;
-
EAST_SHAPE
- Mappings:
Namespace Name Mixin selector named EAST_SHAPELnet/minecraft/block/ButtonBlock;EAST_SHAPE:Lnet/minecraft/util/shape/VoxelShape;intermediary field_10720Lnet/minecraft/class_2269;field_10720:Lnet/minecraft/class_265;official lLdgi;l:Lexv;
-
CEILING_X_PRESSED_SHAPE
- Mappings:
Namespace Name Mixin selector named CEILING_X_PRESSED_SHAPELnet/minecraft/block/ButtonBlock;CEILING_X_PRESSED_SHAPE:Lnet/minecraft/util/shape/VoxelShape;intermediary field_10717Lnet/minecraft/class_2269;field_10717:Lnet/minecraft/class_265;official mLdgi;m:Lexv;
-
CEILING_Z_PRESSED_SHAPE
- Mappings:
Namespace Name Mixin selector named CEILING_Z_PRESSED_SHAPELnet/minecraft/block/ButtonBlock;CEILING_Z_PRESSED_SHAPE:Lnet/minecraft/util/shape/VoxelShape;intermediary field_10726Lnet/minecraft/class_2269;field_10726:Lnet/minecraft/class_265;official nLdgi;n:Lexv;
-
FLOOR_X_PRESSED_SHAPE
- Mappings:
Namespace Name Mixin selector named FLOOR_X_PRESSED_SHAPELnet/minecraft/block/ButtonBlock;FLOOR_X_PRESSED_SHAPE:Lnet/minecraft/util/shape/VoxelShape;intermediary field_10722Lnet/minecraft/class_2269;field_10722:Lnet/minecraft/class_265;official oLdgi;o:Lexv;
-
FLOOR_Z_PRESSED_SHAPE
- Mappings:
Namespace Name Mixin selector named FLOOR_Z_PRESSED_SHAPELnet/minecraft/block/ButtonBlock;FLOOR_Z_PRESSED_SHAPE:Lnet/minecraft/util/shape/VoxelShape;intermediary field_10730Lnet/minecraft/class_2269;field_10730:Lnet/minecraft/class_265;official FLdgi;F:Lexv;
-
NORTH_PRESSED_SHAPE
- Mappings:
Namespace Name Mixin selector named NORTH_PRESSED_SHAPELnet/minecraft/block/ButtonBlock;NORTH_PRESSED_SHAPE:Lnet/minecraft/util/shape/VoxelShape;intermediary field_10719Lnet/minecraft/class_2269;field_10719:Lnet/minecraft/class_265;official GLdgi;G:Lexv;
-
SOUTH_PRESSED_SHAPE
- Mappings:
Namespace Name Mixin selector named SOUTH_PRESSED_SHAPELnet/minecraft/block/ButtonBlock;SOUTH_PRESSED_SHAPE:Lnet/minecraft/util/shape/VoxelShape;intermediary field_10724Lnet/minecraft/class_2269;field_10724:Lnet/minecraft/class_265;official HLdgi;H:Lexv;
-
WEST_PRESSED_SHAPE
- Mappings:
Namespace Name Mixin selector named WEST_PRESSED_SHAPELnet/minecraft/block/ButtonBlock;WEST_PRESSED_SHAPE:Lnet/minecraft/util/shape/VoxelShape;intermediary field_10732Lnet/minecraft/class_2269;field_10732:Lnet/minecraft/class_265;official ILdgi;I:Lexv;
-
EAST_PRESSED_SHAPE
- Mappings:
Namespace Name Mixin selector named EAST_PRESSED_SHAPELnet/minecraft/block/ButtonBlock;EAST_PRESSED_SHAPE:Lnet/minecraft/util/shape/VoxelShape;intermediary field_10718Lnet/minecraft/class_2269;field_10718:Lnet/minecraft/class_265;official JLdgi;J:Lexv;
-
blockSetType
- Mappings:
Namespace Name Mixin selector named blockSetTypeLnet/minecraft/block/ButtonBlock;blockSetType:Lnet/minecraft/block/BlockSetType;intermediary field_42753Lnet/minecraft/class_2269;field_42753:Lnet/minecraft/class_8177;official NLdgi;N:Ldtr;
-
pressTicks
private final int pressTicks- Mappings:
Namespace Name Mixin selector named pressTicksLnet/minecraft/block/ButtonBlock;pressTicks:Iintermediary field_40298Lnet/minecraft/class_2269;field_40298:Iofficial OLdgi;O:I
-
-
Constructor Details
-
ButtonBlock
- Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/block/ButtonBlock;<init>(Lnet/minecraft/block/BlockSetType;ILnet/minecraft/block/AbstractBlock$Settings;)Vintermediary <init>Lnet/minecraft/class_2269;<init>(Lnet/minecraft/class_8177;ILnet/minecraft/class_4970$class_2251;)Vofficial <init>Ldgi;<init>(Ldtr;ILdtb$d;)V
-
-
Method Details
-
getCodec
- Specified by:
getCodecin classWallMountedBlock- Mappings:
Namespace Name Mixin selector named getCodecLnet/minecraft/block/AbstractBlock;getCodec()Lcom/mojang/serialization/MapCodec;intermediary method_53969Lnet/minecraft/class_4970;method_53969()Lcom/mojang/serialization/MapCodec;official aLdtb;a()Lcom/mojang/serialization/MapCodec;
-
getOutlineShape
protected VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) - Overrides:
getOutlineShapein classAbstractBlock- See Also:
- Mappings:
Namespace Name Mixin selector 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;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;official aLdtb;a(Ldtc;Ldcc;Ljd;Lexh;)Lexv;
-
onUse
protected ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, BlockHitResult hit) - Overrides:
onUsein classAbstractBlock- Mappings:
Namespace Name Mixin selector 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/hit/BlockHitResult;)Lnet/minecraft/util/ActionResult;intermediary method_55766Lnet/minecraft/class_4970;method_55766(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1657;Lnet/minecraft/class_3965;)Lnet/minecraft/class_1269;official aLdtb;a(Ldtc;Ldcw;Ljd;Lcmx;Lewy;)Lbqr;
-
onExploded
protected void onExploded(BlockState state, World world, BlockPos pos, Explosion explosion, BiConsumer<ItemStack, BlockPos> stackMerger) - Overrides:
onExplodedin classAbstractBlock- Mappings:
Namespace Name Mixin selector named onExplodedLnet/minecraft/block/AbstractBlock;onExploded(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/world/explosion/Explosion;Ljava/util/function/BiConsumer;)Vintermediary method_55124Lnet/minecraft/class_4970;method_55124(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1927;Ljava/util/function/BiConsumer;)Vofficial aLdtb;a(Ldtc;Ldcw;Ljd;Ldco;Ljava/util/function/BiConsumer;)V
-
powerOn
public void powerOn(BlockState state, World world, BlockPos pos, @Nullable @Nullable PlayerEntity player) - Mappings:
Namespace Name Mixin selector named powerOnLnet/minecraft/block/ButtonBlock;powerOn(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/player/PlayerEntity;)Vintermediary method_21845Lnet/minecraft/class_2269;method_21845(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1657;)Vofficial aLdgi;a(Ldtc;Ldcw;Ljd;Lcmx;)V
-
playClickSound
protected void playClickSound(@Nullable @Nullable PlayerEntity player, WorldAccess world, BlockPos pos, boolean powered) - Mappings:
Namespace Name Mixin selector named playClickSoundLnet/minecraft/block/ButtonBlock;playClickSound(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Z)Vintermediary method_9714Lnet/minecraft/class_2269;method_9714(Lnet/minecraft/class_1657;Lnet/minecraft/class_1936;Lnet/minecraft/class_2338;Z)Vofficial aLdgi;a(Lcmx;Ldcx;Ljd;Z)V
-
getClickSound
- Mappings:
Namespace Name Mixin selector named getClickSoundLnet/minecraft/block/ButtonBlock;getClickSound(Z)Lnet/minecraft/sound/SoundEvent;intermediary method_9712Lnet/minecraft/class_2269;method_9712(Z)Lnet/minecraft/class_3414;official aLdgi;a(Z)Lavo;
-
onStateReplaced
protected void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) 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.For most block entities,
ItemScatterer.onStateReplaced(net.minecraft.block.BlockState, net.minecraft.block.BlockState, net.minecraft.world.World, net.minecraft.util.math.BlockPos)provides a good implementation of this method. Make sure to callsuper.onStateReplaced(state, world, pos, newState, moved);after invokingItemScatterermethods.- Overrides:
onStateReplacedin classAbstractBlock- See Also:
- Mappings:
Namespace Name Mixin selector named onStateReplacedLnet/minecraft/block/AbstractBlock;onStateReplaced(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;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)Vofficial aLdtb;a(Ldtc;Ldcw;Ljd;Ldtc;Z)V
-
getWeakRedstonePower
protected int getWeakRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction) 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.- Overrides:
getWeakRedstonePowerin classAbstractBlock- Returns:
- the weak redstone power emitted from the block
- See Also:
- Mappings:
Namespace Name Mixin selector named getWeakRedstonePowerLnet/minecraft/block/AbstractBlock;getWeakRedstonePower(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;)Iintermediary method_9524Lnet/minecraft/class_4970;method_9524(Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;Lnet/minecraft/class_2350;)Iofficial aLdtb;a(Ldtc;Ldcc;Ljd;Lji;)I
-
getStrongRedstonePower
protected int getStrongRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction) 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.- Overrides:
getStrongRedstonePowerin classAbstractBlock- Returns:
- the strong redstone power emitted from the block
- See Also:
- Mappings:
Namespace Name Mixin selector named getStrongRedstonePowerLnet/minecraft/block/AbstractBlock;getStrongRedstonePower(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;)Iintermediary method_9603Lnet/minecraft/class_4970;method_9603(Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;Lnet/minecraft/class_2350;)Iofficial bLdtb;b(Ldtc;Ldcc;Ljd;Lji;)I
-
emitsRedstonePower
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.- Overrides:
emitsRedstonePowerin classAbstractBlock- Returns:
- whether the block is capable of emitting redstone power
- See Also:
- Mappings:
Namespace Name Mixin selector named emitsRedstonePowerLnet/minecraft/block/AbstractBlock;emitsRedstonePower(Lnet/minecraft/block/BlockState;)Zintermediary method_9506Lnet/minecraft/class_4970;method_9506(Lnet/minecraft/class_2680;)Zofficial e_Ldtb;e_(Ldtc;)Z
-
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
WallMountedBlock.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.
- Overrides:
scheduledTickin classAbstractBlock- See Also:
- Mappings:
Namespace Name Mixin selector named 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;)Vintermediary method_9588Lnet/minecraft/class_4970;method_9588(Lnet/minecraft/class_2680;Lnet/minecraft/class_3218;Lnet/minecraft/class_2338;Lnet/minecraft/class_5819;)Vofficial aLdtb;a(Ldtc;Laqu;Ljd;Layw;)V
-
onEntityCollision
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.
- Overrides:
onEntityCollisionin classAbstractBlock- See Also:
- Mappings:
Namespace Name Mixin selector named onEntityCollisionLnet/minecraft/block/AbstractBlock;onEntityCollision(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/Entity;)Vintermediary method_9548Lnet/minecraft/class_4970;method_9548(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1297;)Vofficial aLdtb;a(Ldtc;Ldcw;Ljd;Lbsr;)V
-
tryPowerWithProjectiles
- Mappings:
Namespace Name Mixin selector named tryPowerWithProjectilesLnet/minecraft/block/ButtonBlock;tryPowerWithProjectiles(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)Vintermediary method_9715Lnet/minecraft/class_2269;method_9715(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;)Vofficial dLdgi;d(Ldtc;Ldcw;Ljd;)V
-
updateNeighbors
- Mappings:
Namespace Name Mixin selector named updateNeighborsLnet/minecraft/block/ButtonBlock;updateNeighbors(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)Vintermediary method_9713Lnet/minecraft/class_2269;method_9713(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;)Vofficial eLdgi;e(Ldtc;Ldcw;Ljd;)V
-
appendProperties
Appends block state properties to this block. To use this, override and callStateManager.Builder.add(net.minecraft.state.property.Property<?>[])inside the method. SeePropertiesfor the list of pre-defined properties.- Overrides:
appendPropertiesin classBlock- Mappings:
Namespace Name Mixin selector named appendPropertiesLnet/minecraft/block/Block;appendProperties(Lnet/minecraft/state/StateManager$Builder;)Vintermediary method_9515Lnet/minecraft/class_2248;method_9515(Lnet/minecraft/class_2689$class_2690;)Vofficial aLdfy;a(Ldtd$a;)V
-