Package net.minecraft.world.level.block
Class ButtonBlock
- All Implemented Interfaces:
- FeatureElement,- ItemLike,- IBlockExtension
- 
Nested Class SummaryNested classes/interfaces inherited from class net.minecraft.world.level.block.BlockBlock.BlockStatePairKeyNested classes/interfaces inherited from class net.minecraft.world.level.block.state.BlockBehaviourBlockBehaviour.BlockStateBase, BlockBehaviour.OffsetFunction, BlockBehaviour.OffsetType, BlockBehaviour.Properties, BlockBehaviour.StateArgumentPredicate<A>, BlockBehaviour.StatePredicate
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected static final VoxelShapeprotected static final VoxelShapestatic final com.mojang.serialization.MapCodec<ButtonBlock>protected static final VoxelShapeprotected static final VoxelShapeprotected static final VoxelShapeprotected static final intprotected static final intprotected static final VoxelShapestatic final BooleanPropertyprotected static final VoxelShapeprotected static final VoxelShapeprivate static final intprotected static final VoxelShapeprotected static final VoxelShapeprotected static final VoxelShapeprotected static final VoxelShapeprotected static final VoxelShapeprotected static final VoxelShapeprotected static final VoxelShapeprivate final intprivate final BlockSetTypeprivate static final intprotected static final VoxelShapeFields inherited from class net.minecraft.world.level.block.FaceAttachedHorizontalDirectionalBlockFACEFields inherited from class net.minecraft.world.level.block.HorizontalDirectionalBlockFACINGFields inherited from class net.minecraft.world.level.block.BlockBLOCK_STATE_REGISTRY, INDESTRUCTIBLE, INSTANT, stateDefinition, UPDATE_ALL, UPDATE_ALL_IMMEDIATE, UPDATE_CLIENTS, UPDATE_IMMEDIATE, UPDATE_INVISIBLE, UPDATE_KNOWN_SHAPE, UPDATE_LIMIT, UPDATE_MOVE_BY_PISTON, UPDATE_NEIGHBORS, UPDATE_NONE, UPDATE_SUPPRESS_DROPSFields inherited from class net.minecraft.world.level.block.state.BlockBehaviourdrops, dynamicShape, explosionResistance, friction, hasCollision, isRandomlyTicking, jumpFactor, properties, requiredFeatures, soundType, speedFactor, UPDATE_SHAPE_ORDERFields inherited from interface net.minecraft.world.flag.FeatureElementFILTERED_REGISTRIES
- 
Constructor SummaryConstructorsConstructorDescriptionButtonBlock(BlockSetType p_273462_, int p_273212_, BlockBehaviour.Properties p_273290_) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidcheckPressed(BlockState p_51121_, Level p_51122_, BlockPos p_51123_) com.mojang.serialization.MapCodec<ButtonBlock>codec()protected voidvoidentityInside(BlockState p_51083_, Level p_51084_, BlockPos p_51085_, Entity p_51086_) intgetDirectSignal(BlockState p_51109_, BlockGetter p_51110_, BlockPos p_51111_, Direction p_51112_) getShape(BlockState p_51104_, BlockGetter p_51105_, BlockPos p_51106_, CollisionContext p_51107_) intgetSignal(BlockState p_51078_, BlockGetter p_51079_, BlockPos p_51080_, Direction p_51081_) protected SoundEventgetSound(boolean p_51102_) booleanisSignalSource(BlockState p_51114_) voidonExplosionHit(BlockState p_312395_, Level p_311915_, BlockPos p_311817_, Explosion p_312150_, BiConsumer<ItemStack, BlockPos> p_311898_) voidonRemove(BlockState p_51095_, Level p_51096_, BlockPos p_51097_, BlockState p_51098_, boolean p_51099_) protected voidplaySound(Player p_51068_, LevelAccessor p_51069_, BlockPos p_51070_, boolean p_51071_) voidpress(BlockState p_51117_, Level p_51118_, BlockPos p_51119_) voidtick(BlockState p_220903_, ServerLevel p_220904_, BlockPos p_220905_, RandomSource p_220906_) private voidupdateNeighbours(BlockState p_51125_, Level p_51126_, BlockPos p_51127_) use(BlockState p_51088_, Level p_51089_, BlockPos p_51090_, Player p_51091_, InteractionHand p_51092_, BlockHitResult p_51093_) Methods inherited from class net.minecraft.world.level.block.FaceAttachedHorizontalDirectionalBlockcanAttach, canSurvive, getConnectedDirection, getStateForPlacement, updateShapeMethods inherited from class net.minecraft.world.level.block.HorizontalDirectionalBlockmirror, rotateMethods inherited from class net.minecraft.world.level.block.BlockanimateTick, appendHoverText, asBlock, asItem, box, builtInRegistryHolder, byItem, canSupportCenter, canSupportRigidBlock, canSustainPlant, defaultBlockState, destroy, dropFromExplosion, dropResources, dropResources, dropResources, dropResources, fallOn, getCloneItemStack, getDescriptionId, getDrops, getDrops, getExplosionResistance, getFriction, getId, getJumpFactor, getName, getRenderPropertiesInternal, getShapeForEachState, getSoundType, getSpeedFactor, getStateDefinition, handlePrecipitation, hasDynamicShape, initializeClient, isExceptionForConnection, isFaceFull, isPossibleToRespawnInThis, isRandomlyTicking, isShapeFullBlock, playerDestroy, playerWillDestroy, popExperience, popResource, popResourceFromFace, propagatesSkylightDown, pushEntitiesUp, registerDefaultState, setPlacedBy, shouldRenderFace, spawnDestroyParticles, stateById, stepOn, toString, tryDropExperience, updateEntityAfterFallOn, updateFromNeighbourShapes, updateOrDestroy, updateOrDestroy, wasExploded, withPropertiesOfMethods inherited from class net.minecraft.world.level.block.state.BlockBehaviourattack, canBeReplaced, canBeReplaced, defaultDestroyTime, defaultMapColor, getAnalogOutputSignal, getBlockSupportShape, getCollisionShape, getDestroyProgress, getDrops, getFluidState, getInteractionShape, getLightBlock, getLootTable, getMaxHorizontalOffset, getMaxVerticalOffset, getMenuProvider, getOcclusionShape, getRenderShape, getSeed, getShadeBrightness, getVisualShape, hasAnalogOutputSignal, isAir, isCollisionShapeFullBlock, isOcclusionShapeFullBlock, isPathfindable, neighborChanged, onPlace, onProjectileHit, properties, propertiesCodec, randomTick, requiredFeatures, simpleCodec, skipRendering, spawnAfterBreak, triggerEvent, updateIndirectNeighbourShapes, useShapeForLightOcclusionMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.flag.FeatureElementisEnabledMethods inherited from interface net.neoforged.neoforge.common.extensions.IBlockExtensionaddLandingEffects, addRunningEffects, canBeHydrated, canConnectRedstone, canDropFromExplosion, canEntityDestroy, canHarvestBlock, canStickTo, collisionExtendsVertically, getAdjacentBlockPathType, getAppearance, getBeaconColorMultiplier, getBedDirection, getBlockPathType, getCloneItemStack, getEnchantPowerBonus, getExpDrop, getExplosionResistance, getFireSpreadSpeed, getFlammability, getFriction, getLightEmission, getMapColor, getPistonPushReaction, getRespawnPosition, getSoundType, getStateAtViewpoint, getToolModifiedState, getWeakChanges, hidesNeighborFace, isBed, isBurning, isConduitFrame, isEmpty, isFertile, isFireSource, isFlammable, isLadder, isPortalFrame, isScaffolding, isSlimeBlock, isStickyBlock, isValidSpawn, makesOpenTrapdoorAboveClimbable, onBlockExploded, onBlockStateChange, onCaughtFire, onDestroyedByPlayer, onNeighborChange, onTreeGrow, rotate, setBedOccupied, shouldCheckWeakPower, shouldDisplayFluidOverlay, supportsExternalFaceHiding
- 
Field Details- 
CODEC
- 
POWERED
- 
PRESSED_DEPTHprivate static final int PRESSED_DEPTH- See Also:
 
- 
UNPRESSED_DEPTHprivate static final int UNPRESSED_DEPTH- See Also:
 
- 
HALF_AABB_HEIGHTprotected static final int HALF_AABB_HEIGHT- See Also:
 
- 
HALF_AABB_WIDTHprotected static final int HALF_AABB_WIDTH- See Also:
 
- 
CEILING_AABB_X
- 
CEILING_AABB_Z
- 
FLOOR_AABB_X
- 
FLOOR_AABB_Z
- 
NORTH_AABB
- 
SOUTH_AABB
- 
WEST_AABB
- 
EAST_AABB
- 
PRESSED_CEILING_AABB_X
- 
PRESSED_CEILING_AABB_Z
- 
PRESSED_FLOOR_AABB_X
- 
PRESSED_FLOOR_AABB_Z
- 
PRESSED_NORTH_AABB
- 
PRESSED_SOUTH_AABB
- 
PRESSED_WEST_AABB
- 
PRESSED_EAST_AABB
- 
type
- 
ticksToStayPressedprivate final int ticksToStayPressed
 
- 
- 
Constructor Details- 
ButtonBlock
 
- 
- 
Method Details- 
codec- Specified by:
- codecin class- FaceAttachedHorizontalDirectionalBlock
 
- 
getShapepublic VoxelShape getShape(BlockState p_51104_, BlockGetter p_51105_, BlockPos p_51106_, CollisionContext p_51107_) - Overrides:
- getShapein class- BlockBehaviour
 
- 
usepublic InteractionResult use(BlockState p_51088_, Level p_51089_, BlockPos p_51090_, Player p_51091_, InteractionHand p_51092_, BlockHitResult p_51093_) - Overrides:
- usein class- BlockBehaviour
 
- 
onExplosionHitpublic void onExplosionHit(BlockState p_312395_, Level p_311915_, BlockPos p_311817_, Explosion p_312150_, BiConsumer<ItemStack, BlockPos> p_311898_) - Overrides:
- onExplosionHitin class- BlockBehaviour
 
- 
press
- 
playSoundprotected void playSound(@Nullable Player p_51068_, LevelAccessor p_51069_, BlockPos p_51070_, boolean p_51071_) 
- 
getSound
- 
onRemovepublic void onRemove(BlockState p_51095_, Level p_51096_, BlockPos p_51097_, BlockState p_51098_, boolean p_51099_) - Overrides:
- onRemovein class- BlockBehaviour
 
- 
getSignalpublic int getSignal(BlockState p_51078_, BlockGetter p_51079_, BlockPos p_51080_, Direction p_51081_) - Overrides:
- getSignalin class- BlockBehaviour
 
- 
getDirectSignalpublic int getDirectSignal(BlockState p_51109_, BlockGetter p_51110_, BlockPos p_51111_, Direction p_51112_) - Overrides:
- getDirectSignalin class- BlockBehaviour
 
- 
isSignalSource- Overrides:
- isSignalSourcein class- BlockBehaviour
 
- 
tickpublic void tick(BlockState p_220903_, ServerLevel p_220904_, BlockPos p_220905_, RandomSource p_220906_) - Overrides:
- tickin class- BlockBehaviour
 
- 
entityInside- Overrides:
- entityInsidein class- BlockBehaviour
 
- 
checkPressed
- 
updateNeighbours
- 
createBlockStateDefinition- Overrides:
- createBlockStateDefinitionin class- Block
 
 
-