Class BlockBehaviour
java.lang.Object
net.minecraft.world.level.block.state.BlockBehaviour
- All Implemented Interfaces:
FeatureElement
- Direct Known Subclasses:
Block
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic interfacestatic enumstatic interfacestatic classstatic interfacestatic interface -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Stringprotected final Optional<ResourceKey<LootTable>> protected final booleanprotected final floatprotected final floatprotected final booleanprotected final booleanprotected final floatprotected final BlockBehaviour.Propertiesprotected final FeatureFlagSetprotected final SoundTypeprotected final floatprotected static final Direction[]Fields inherited from interface FeatureElement
FILTERED_REGISTRIES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaffectNeighborsAfterRemoval(BlockState state, ServerLevel level, BlockPos pos, boolean movedByPiston) protected abstract BlockasBlock()abstract ItemasItem()protected voidattack(BlockState state, Level level, BlockPos pos, Player player) protected booleancanBeReplaced(BlockState state, BlockPlaceContext context) protected booleancanBeReplaced(BlockState state, Fluid fluid) protected booleancanSurvive(BlockState state, LevelReader level, BlockPos pos) codec()floatprotected voidentityInside(BlockState state, Level level, BlockPos pos, Entity entity, InsideBlockEffectApplier effectApplier, boolean isPrecise) protected intgetAnalogOutputSignal(BlockState state, Level level, BlockPos pos, Direction direction) protected VoxelShapegetBlockSupportShape(BlockState state, BlockGetter level, BlockPos pos) protected ItemStackgetCloneItemStack(LevelReader level, BlockPos pos, BlockState state, boolean includeData) Deprecated.protected VoxelShapegetCollisionShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) final Stringprotected floatgetDestroyProgress(BlockState state, Player player, BlockGetter level, BlockPos pos) protected intgetDirectSignal(BlockState state, BlockGetter level, BlockPos pos, Direction direction) getDrops(BlockState state, LootParams.Builder params) protected VoxelShapegetEntityInsideCollisionShape(BlockState state, BlockGetter level, BlockPos pos, Entity entity) protected FluidStategetFluidState(BlockState state) protected VoxelShapegetInteractionShape(BlockState state, BlockGetter level, BlockPos pos) protected intgetLightDampening(BlockState state) final Optional<ResourceKey<LootTable>> protected floatprotected floatprotected @Nullable MenuProvidergetMenuProvider(BlockState state, Level level, BlockPos pos) protected VoxelShapegetOcclusionShape(BlockState state) protected RenderShapegetRenderShape(BlockState state) protected longgetSeed(BlockState state, BlockPos pos) protected floatgetShadeBrightness(BlockState state, BlockGetter level, BlockPos pos) protected VoxelShapegetShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) protected intgetSignal(BlockState state, BlockGetter level, BlockPos pos, Direction direction) protected SoundTypegetSoundType(BlockState state) Deprecated.protected VoxelShapegetVisualShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) protected booleanhasAnalogOutputSignal(BlockState state) protected booleanisAir(BlockState state) protected booleanisCollisionShapeFullBlock(BlockState state, BlockGetter level, BlockPos pos) protected booleanisPathfindable(BlockState state, PathComputationType type) protected booleanisRandomlyTicking(BlockState state) protected booleanisSignalSource(BlockState state) protected BlockStatemirror(BlockState state, Mirror mirror) protected voidneighborChanged(BlockState state, Level level, BlockPos pos, Block block, @Nullable Orientation orientation, boolean movedByPiston) protected voidonExplosionHit(BlockState state, ServerLevel level, BlockPos pos, Explosion explosion, BiConsumer<ItemStack, BlockPos> onHit) protected voidonPlace(BlockState state, Level level, BlockPos pos, BlockState oldState, boolean movedByPiston) protected voidonProjectileHit(Level level, BlockState state, BlockHitResult blockHit, Projectile projectile) protected booleanpropagatesSkylightDown(BlockState state) static <B extends Block>
RecordCodecBuilder<B, BlockBehaviour.Properties> protected voidrandomTick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) protected BlockStaterotate(BlockState state, Rotation rotation) protected booleanshouldChangedStateKeepBlockEntity(BlockState oldState) simpleCodec(Function<BlockBehaviour.Properties, B> constructor) protected booleanskipRendering(BlockState state, BlockState neighborState, Direction direction) protected voidspawnAfterBreak(BlockState state, ServerLevel level, BlockPos pos, ItemStack tool, boolean dropExperience) protected voidtick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) protected booleantriggerEvent(BlockState state, Level level, BlockPos pos, int b0, int b1) protected voidupdateIndirectNeighbourShapes(BlockState state, LevelAccessor level, BlockPos pos, int updateFlags, int updateLimit) protected BlockStateupdateShape(BlockState state, LevelReader level, ScheduledTickAccess ticks, BlockPos pos, Direction directionToNeighbour, BlockPos neighbourPos, BlockState neighbourState, RandomSource random) protected InteractionResultuseItemOn(ItemStack itemStack, BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hitResult) protected booleanprotected InteractionResultuseWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface FeatureElement
isEnabled
-
Field Details
-
UPDATE_SHAPE_ORDER
-
hasCollision
protected final boolean hasCollision -
explosionResistance
protected final float explosionResistance -
isRandomlyTicking
protected final boolean isRandomlyTicking -
soundType
-
friction
protected final float friction -
speedFactor
protected final float speedFactor -
jumpFactor
protected final float jumpFactor -
dynamicShape
protected final boolean dynamicShape -
requiredFeatures
-
properties
-
drops
-
descriptionId
-
-
Constructor Details
-
BlockBehaviour
-
-
Method Details
-
properties
-
codec
-
propertiesCodec
-
simpleCodec
public static <B extends Block> MapCodec<B> simpleCodec(Function<BlockBehaviour.Properties, B> constructor) -
updateIndirectNeighbourShapes
protected void updateIndirectNeighbourShapes(BlockState state, LevelAccessor level, BlockPos pos, int updateFlags, int updateLimit) -
isPathfindable
-
updateShape
protected BlockState updateShape(BlockState state, LevelReader level, ScheduledTickAccess ticks, BlockPos pos, Direction directionToNeighbour, BlockPos neighbourPos, BlockState neighbourState, RandomSource random) -
skipRendering
-
neighborChanged
protected void neighborChanged(BlockState state, Level level, BlockPos pos, Block block, @Nullable Orientation orientation, boolean movedByPiston) -
onPlace
protected void onPlace(BlockState state, Level level, BlockPos pos, BlockState oldState, boolean movedByPiston) -
affectNeighborsAfterRemoval
protected void affectNeighborsAfterRemoval(BlockState state, ServerLevel level, BlockPos pos, boolean movedByPiston) -
onExplosionHit
protected void onExplosionHit(BlockState state, ServerLevel level, BlockPos pos, Explosion explosion, BiConsumer<ItemStack, BlockPos> onHit) -
useWithoutItem
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) -
useItemOn
protected InteractionResult useItemOn(ItemStack itemStack, BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hitResult) -
triggerEvent
-
getRenderShape
-
useShapeForLightOcclusion
-
isSignalSource
-
getFluidState
-
hasAnalogOutputSignal
-
getMaxHorizontalOffset
protected float getMaxHorizontalOffset() -
getMaxVerticalOffset
protected float getMaxVerticalOffset() -
requiredFeatures
- Specified by:
requiredFeaturesin interfaceFeatureElement
-
shouldChangedStateKeepBlockEntity
-
rotate
-
mirror
-
canBeReplaced
-
canBeReplaced
-
getDrops
-
getSeed
-
getOcclusionShape
-
getBlockSupportShape
-
getInteractionShape
-
getLightDampening
-
getMenuProvider
-
canSurvive
-
getShadeBrightness
-
getAnalogOutputSignal
protected int getAnalogOutputSignal(BlockState state, Level level, BlockPos pos, Direction direction) -
getShape
protected VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) -
getCollisionShape
protected VoxelShape getCollisionShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) -
getEntityInsideCollisionShape
protected VoxelShape getEntityInsideCollisionShape(BlockState state, BlockGetter level, BlockPos pos, Entity entity) -
isCollisionShapeFullBlock
-
getVisualShape
protected VoxelShape getVisualShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) -
randomTick
-
tick
-
getDestroyProgress
protected float getDestroyProgress(BlockState state, Player player, BlockGetter level, BlockPos pos) -
spawnAfterBreak
protected void spawnAfterBreak(BlockState state, ServerLevel level, BlockPos pos, ItemStack tool, boolean dropExperience) -
attack
-
getSignal
-
entityInside
protected void entityInside(BlockState state, Level level, BlockPos pos, Entity entity, InsideBlockEffectApplier effectApplier, boolean isPrecise) -
getDirectSignal
protected int getDirectSignal(BlockState state, BlockGetter level, BlockPos pos, Direction direction) -
getLootTable
-
getDescriptionId
-
onProjectileHit
protected void onProjectileHit(Level level, BlockState state, BlockHitResult blockHit, Projectile projectile) -
propagatesSkylightDown
-
isRandomlyTicking
-
getSoundType
Deprecated. -
getCloneItemStack
@Deprecated protected ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state, boolean includeData) Deprecated. -
asItem
-
asBlock
-
defaultMapColor
-
defaultDestroyTime
public float defaultDestroyTime() -
isAir
-