Interface IBlockExtension

All Known Implementing Classes:
net.minecraft.world.level.block.AbstractSkullBlock, net.minecraft.world.level.block.BaseEntityBlock, net.minecraft.world.level.block.BaseRailBlock, net.minecraft.world.level.block.Block, BlockPropertyTests.LightBlock, BlockTests.CustomBubbleColumnSustainingBlock, CanSustainPlantTests.CustomSuperSustainingBlock, net.minecraft.world.level.block.CeilingHangingSignBlock, ClientFluidTests.WaterGlassBlock, CustomHeadTest.CustomSkullBlock, CustomHeadTest.CustomWallSkullBlock, CustomItemDisplayContextTest.ItemHangerBlock, CustomPlantTypeTest.CustomBlock, CustomPlantTypeTest.CustomPlantBlock, CustomSignsTest.CustomCeilingHangingSignBlock, CustomSignsTest.CustomStandingSignBlock, CustomSignsTest.CustomWallHangingSignBlock, CustomSignsTest.CustomWallSignBlock, net.minecraft.world.level.block.FlowerBlock, ForgeChunkManagerTest.ChunkLoaderBlock, FullPotsAccessorDemo.DioriteFlowerPotBlock, net.minecraft.world.level.block.HalfTransparentBlock, HideNeighborFaceTest.GlassSlab, net.minecraft.world.level.block.HorizontalDirectionalBlock, MegaModelTest.TestBlock, NewFluidTest.FluidloggableBlock, NewModelLoaderTest.TestBlock, OnDestroyedByPushReactionTests.DestroyedByPushReactionListeningBlock, RedstoneSidedConnectivityTest.EastRedstoneBlock, net.minecraft.world.level.block.ScaffoldingBlock, ScaffoldingTest.ScaffoldingMethodTestBlock, net.minecraft.world.level.block.SignBlock, net.minecraft.world.level.block.SkullBlock, net.minecraft.world.level.block.SlabBlock, net.minecraft.world.level.block.StandingSignBlock, net.minecraft.world.level.block.TransparentBlock, ValidRailShapeTest.RailSlopeBlock, net.minecraft.world.level.block.VegetationBlock, net.minecraft.world.level.block.WallHangingSignBlock, net.minecraft.world.level.block.WallSignBlock, net.minecraft.world.level.block.WallSkullBlock

public interface IBlockExtension
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    addLandingEffects(net.minecraft.world.level.block.state.BlockState state1, net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state2, net.minecraft.world.entity.LivingEntity entity, int numberOfParticles)
    Allows a block to override the standard EntityLivingBase.updateFallState particles, this is a server side method that spawns particles with WorldServer.spawnParticle.
    default boolean
    addRunningEffects(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.Entity entity)
    Allows a block to override the standard vanilla running particles.
    default boolean
    canBeHydrated(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter getter, net.minecraft.core.BlockPos pos, net.minecraft.world.level.material.FluidState fluid, net.minecraft.core.BlockPos fluidPos)
    Returns whether the block can be hydrated by a fluid.
    default boolean
    canConnectRedstone(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, @Nullable net.minecraft.core.Direction direction)
    Whether redstone dust should visually connect to this block on a given side
    default boolean
    canDropFromExplosion(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.Explosion explosion)
    Determines if this block should drop loot when exploded.
    default boolean
    canEntityDestroy(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.Entity entity)
    Determines if this block is can be destroyed by the specified entities normal behavior.
    default boolean
    canHarvestBlock(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player)
    Determines if the player can harvest this block, obtaining it's drops when the block is destroyed.
    default boolean
    canStickTo(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.block.state.BlockState other)
    Determines if this block can stick to another block when pushed by a piston.
    default net.minecraft.util.TriState
    canSustainPlant(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos soilPosition, net.minecraft.core.Direction facing, net.minecraft.world.level.block.state.BlockState plant)
    Determines if this block either force allow or force disallow a plant from being placed on it.
    default boolean
    collisionExtendsVertically(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.Entity collidingEntity)
    Determines if this block's collision box should be treated as though it can extend above its block space.
    default @Nullable net.minecraft.world.level.pathfinder.PathType
    getAdjacentBlockPathType(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, @Nullable net.minecraft.world.entity.Mob mob, net.minecraft.world.level.pathfinder.PathType originalType)
    Gets the path type of the adjacent block to a pathfinding entity.
    default net.minecraft.world.level.block.state.BlockState
    getAppearance(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockAndTintGetter level, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side, @Nullable net.minecraft.world.level.block.state.BlockState queryState, @Nullable net.minecraft.core.BlockPos queryPos)
    Returns the BlockState that this block reports to look like on the given side, for querying by other mods.
    default @Nullable Integer
    getBeaconColorMultiplier(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.LevelReader level, net.minecraft.core.BlockPos pos, net.minecraft.core.BlockPos beaconPos)
     
    default net.minecraft.core.Direction
    getBedDirection(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.LevelReader level, net.minecraft.core.BlockPos pos)
    Returns the direction of the block.
    default @Nullable net.minecraft.world.level.pathfinder.PathType
    getBlockPathType(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, @Nullable net.minecraft.world.entity.Mob mob)
    Gets the path type of this block when an entity is pathfinding.
    getBubbleColumnDirection(net.minecraft.world.level.block.state.BlockState state)
    Determines if this block can spawn Bubble Columns and if so, what direction the column flows.
    default net.minecraft.world.item.ItemStack
    getCloneItemStack(net.minecraft.world.level.LevelReader level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, boolean includeData, net.minecraft.world.entity.player.Player player)
    Called when A user uses the creative pick block button on this block
    default float
    getEnchantPowerBonus(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.LevelReader level, net.minecraft.core.BlockPos pos)
    Determines the amount of enchanting power this block can provide to an enchanting table.
    default int
    getExpDrop(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.LevelAccessor level, net.minecraft.core.BlockPos pos, @Nullable net.minecraft.world.level.block.entity.BlockEntity blockEntity, @Nullable net.minecraft.world.entity.Entity breaker, net.minecraft.world.item.ItemStack tool)
    Returns how many experience points this block drops when broken, before application of enchantments.
    default float
    getExplosionResistance(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.Explosion explosion)
    Location sensitive version of getExplosionResistance
    default int
    getFireSpreadSpeed(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction direction)
    Called when fire is updating on a neighbor block.
    default int
    getFlammability(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction direction)
    Chance that fire will spread and consume this block. 300 being a 100% chance, 0, being a 0% chance.
    default float
    getFriction(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.LevelReader level, net.minecraft.core.BlockPos pos, @Nullable net.minecraft.world.entity.Entity entity)
    Gets the slipperiness at the given location at the given state.
    default int
    getLightEmission(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos)
    Get a light value for this block, taking into account the given state and coordinates, normal ranges are between 0 and 15
    default net.minecraft.world.level.material.MapColor
    getMapColor(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.material.MapColor defaultColor)
    Returns the MapColor shown on the map.
    default @Nullable net.minecraft.world.level.material.PushReaction
    getPistonPushReaction(net.minecraft.world.level.block.state.BlockState state)
    Returns the reaction of the block when pushed or pulled by a piston.
    default Optional<net.minecraft.server.level.ServerPlayer.RespawnPosAngle>
    getRespawnPosition(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.entity.EntityType<?> type, net.minecraft.world.level.LevelReader levelReader, net.minecraft.core.BlockPos pos, float orientation)
    Returns the position that the entity is moved to upon respawning at this block.
    default net.minecraft.world.level.block.SoundType
    getSoundType(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.LevelReader level, net.minecraft.core.BlockPos pos, @Nullable net.minecraft.world.entity.Entity entity)
    Sensitive version of getSoundType
    default net.minecraft.world.level.block.state.BlockState
    getStateAtViewpoint(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.phys.Vec3 viewpoint)
    Used to determine the state 'viewed' by an entity (see
    invalid reference
    Camera#getBlockAtCamera()
    ).
    default @Nullable net.minecraft.world.level.block.state.BlockState
    getToolModifiedState(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.item.context.UseOnContext context, ItemAbility itemAbility, boolean simulate)
    Returns the state that this block should transform into when right-clicked by a tool.
    default boolean
    getWeakChanges(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.LevelReader level, net.minecraft.core.BlockPos pos)
    If this block should be notified of weak changes.
    default boolean
    hasDynamicLightEmission(net.minecraft.world.level.block.state.BlockState state)
    Whether this block has dynamic light emission which is not solely based on the BlockState and instead uses the BlockPos, the AuxiliaryLightManager or another external data source to determine its light value in getLightEmission(BlockState, BlockGetter, BlockPos)
    default boolean
    hidesNeighborFace(net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.block.state.BlockState neighborState, net.minecraft.core.Direction dir)
    Whether this block hides the neighbors face pointed towards by the given direction.
    default boolean
    isBed(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.LivingEntity sleeper)
    Determines if this block is classified as a bed, replacing instanceof BedBlock checks.
    default boolean
    isBurning(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos)
    Determines if this block should set fire and deal fire damage to entities coming into contact with it.
    default boolean
    isConduitFrame(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.LevelReader level, net.minecraft.core.BlockPos pos, net.minecraft.core.BlockPos conduit)
    Determines if this block can be used as the frame of a conduit.
    default boolean
    isEmpty(net.minecraft.world.level.block.state.BlockState state)
    Return true if the state is able to be replaced with Blocks.AIR in chunk sections that is entirely made of blocks that return true for isEmpty
    default boolean
    isFertile(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos)
    Checks if this soil is fertile, typically this means that growth rates of plants on this soil will be slightly sped up.
    default boolean
    isFireSource(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.LevelReader level, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction direction)
    Currently only called by fire when it is on top of this block.
    default boolean
    isFlammable(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction direction)
    Called when fire is updating, checks if a block face can catch fire.
    default boolean
    isLadder(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.LevelReader level, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.LivingEntity entity)
    Checks if a player or entity can use this block to 'climb' like a ladder.
    default boolean
    isPortalFrame(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos)
    Determines if this block can be used as part of a frame of a nether portal.
    default boolean
    isScaffolding(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.LevelReader level, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.LivingEntity entity)
    Checks if a player or entity handles movement on this block like scaffolding.
    default boolean
    isSlimeBlock(net.minecraft.world.level.block.state.BlockState state)
     
    default boolean
    isStickyBlock(net.minecraft.world.level.block.state.BlockState state)
     
    default boolean
    makesOpenTrapdoorAboveClimbable(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.LevelReader level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState trapdoorState)
    Checks if this block makes an open trapdoor above it climbable.
    default void
    onBlockExploded(net.minecraft.world.level.block.state.BlockState state, net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.Explosion explosion)
    Called when the block is destroyed by an explosion.
    default void
    onBlockStateChange(net.minecraft.world.level.LevelReader level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState oldState, net.minecraft.world.level.block.state.BlockState newState)
    Called after the BlockState at the given BlockPos was changed and neighbors were updated.
    default boolean
    onCaughtFire(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, @Nullable net.minecraft.core.Direction direction, @Nullable net.minecraft.world.entity.LivingEntity igniter)
    If the block is flammable, this is called when it gets lit on fire.
    default boolean
    onDestroyedByPlayer(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player, boolean willHarvest, net.minecraft.world.level.material.FluidState fluid)
    Called when a player removes a block.
    default void
    onDestroyedByPushReaction(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction pushDirection, net.minecraft.world.level.material.FluidState fluid)
    Called when a block is removed by PushReaction.DESTROY.
    default void
    onNeighborChange(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.LevelReader level, net.minecraft.core.BlockPos pos, net.minecraft.core.BlockPos neighbor)
    Called when a block entity on a side of this block changes, is created, or is destroyed.
    default boolean
    onTreeGrow(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.LevelReader level, BiConsumer<net.minecraft.core.BlockPos,net.minecraft.world.level.block.state.BlockState> placeFunction, net.minecraft.util.RandomSource randomSource, net.minecraft.core.BlockPos pos, net.minecraft.world.level.levelgen.feature.configurations.TreeConfiguration config)
    Called when a tree grows on top of this block and tries to set it to dirt by the trunk placer.
    default net.minecraft.world.level.block.state.BlockState
    rotate(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.LevelAccessor level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.Rotation direction)
     
    private net.minecraft.world.level.block.Block
     
    default void
    setBedOccupied(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.LivingEntity sleeper, boolean occupied)
    Called when a user either starts or stops sleeping in the bed.
    default boolean
    shouldCheckWeakPower(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.SignalGetter level, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side)
    Called to determine whether to allow the block to handle its own indirect power rather than using the default rules.
    default boolean
    shouldDisplayFluidOverlay(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockAndTintGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.material.FluidState fluidState)
    Called to determine whether this block should use the fluid overlay texture or flowing texture when it is placed under the fluid.
    default boolean
    shouldHideAdjacentFluidFace(net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.Direction selfFace, net.minecraft.world.level.material.FluidState adjacentFluid)
    Determines if a fluid adjacent to the block on the given side should not be rendered.
    default boolean
    supportsExternalFaceHiding(net.minecraft.world.level.block.state.BlockState state)
    Whether this block allows a neighboring block to hide the face of this block it touches.
  • Method Details

    • self

      private net.minecraft.world.level.block.Block self()
    • getFriction

      default float getFriction(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.LevelReader level, net.minecraft.core.BlockPos pos, @Nullable @Nullable net.minecraft.world.entity.Entity entity)
      Gets the slipperiness at the given location at the given state. Normally between 0 and 1.

      Note that entities may reduce slipperiness by a certain factor of their own; for LivingEntity, this is .91. ItemEntity uses .98, and FishingHook uses .92.

      Parameters:
      state - state of the block
      level - the level
      pos - the position in the level
      entity - the entity in question
      Returns:
      the factor by which the entity's motion should be multiplied
    • hasDynamicLightEmission

      default boolean hasDynamicLightEmission(net.minecraft.world.level.block.state.BlockState state)
      Whether this block has dynamic light emission which is not solely based on the BlockState and instead uses the BlockPos, the AuxiliaryLightManager or another external data source to determine its light value in getLightEmission(BlockState, BlockGetter, BlockPos)
      Parameters:
      state - the block state being checked
      Returns:
      true if this block cannot determine its light emission solely based on the block state, false otherwise
    • getLightEmission

      default int getLightEmission(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos)
      Get a light value for this block, taking into account the given state and coordinates, normal ranges are between 0 and 15
      Parameters:
      state - The state of this block
      level - The level this block is in, may be EmptyBlockGetter.INSTANCE, see implementation notes
      pos - The position of this block in the level, may be BlockPos.ZERO, see implementation notes
      Returns:
      The light value
    • isLadder

      default boolean isLadder(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.LevelReader level, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.LivingEntity entity)
      Checks if a player or entity can use this block to 'climb' like a ladder.
      Parameters:
      state - The current state
      level - The current level
      pos - Block position in level
      entity - The entity trying to use the ladder, CAN be null.
      Returns:
      True if the block should act like a ladder
    • makesOpenTrapdoorAboveClimbable

      default boolean makesOpenTrapdoorAboveClimbable(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.LevelReader level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState trapdoorState)
      Checks if this block makes an open trapdoor above it climbable.
      Parameters:
      state - The current state
      level - The current level
      pos - Block position in level
      trapdoorState - The current state of the open trapdoor above
      Returns:
      True if the block should act like a ladder
    • isBurning

      default boolean isBurning(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos)
      Determines if this block should set fire and deal fire damage to entities coming into contact with it.
      Parameters:
      level - The current level
      pos - Block position in level
      Returns:
      True if the block should deal damage
    • canHarvestBlock

      default boolean canHarvestBlock(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player)
      Determines if the player can harvest this block, obtaining it's drops when the block is destroyed.
      Parameters:
      level - The current level
      pos - The block's current position
      player - The player damaging the block
      Returns:
      True to spawn the drops
    • onDestroyedByPlayer

      default boolean onDestroyedByPlayer(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player, boolean willHarvest, net.minecraft.world.level.material.FluidState fluid)
      Called when a player removes a block. This is responsible for actually destroying the block, and the block is intact at time of call. This is called regardless of whether the player can harvest the block or not. Return true if the block is actually destroyed. This function is called on both the logical client and logical server.
      Parameters:
      state - The current state.
      level - The current level
      pos - Block position in level
      player - The player damaging the block, may be null
      willHarvest - The result of canHarvestBlock(net.minecraft.world.level.block.state.BlockState, net.minecraft.world.level.BlockGetter, net.minecraft.core.BlockPos, net.minecraft.world.entity.player.Player), if called on the server by a non-creative player, otherwise always false.
      fluid - The current fluid state at current position
      Returns:
      True if the block is actually destroyed.
    • onDestroyedByPushReaction

      default void onDestroyedByPushReaction(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction pushDirection, net.minecraft.world.level.material.FluidState fluid)
      Called when a block is removed by PushReaction.DESTROY. This is responsible for actually destroying the block, and the block is intact at time of call.

      Will only be called if BlockBehaviour.BlockStateBase.getPistonPushReaction() returns PushReaction.DESTROY.

      Note: When used in multiplayer, this is called on both client and server sides!

      Parameters:
      state - The current state.
      level - The current level
      pos - Block position in level
      pushDirection - The direction of block movement
      fluid - The current fluid state at current position
    • isBed

      default boolean isBed(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.LivingEntity sleeper)
      Determines if this block is classified as a bed, replacing instanceof BedBlock checks.

      If true, players may sleep in it, though the block must manually put the player to sleep by calling Player.startSleepInBed(net.minecraft.core.BlockPos) from BlockBehaviour.useWithoutItem(net.minecraft.world.level.block.state.BlockState, net.minecraft.world.level.Level, net.minecraft.core.BlockPos, net.minecraft.world.entity.player.Player, net.minecraft.world.phys.BlockHitResult) or similar.

      If you want players to be able to respawn at your bed, you also need to override getRespawnPosition(net.minecraft.world.level.block.state.BlockState, net.minecraft.world.entity.EntityType<?>, net.minecraft.world.level.LevelReader, net.minecraft.core.BlockPos, float).

      Parameters:
      state - The current state
      level - The current level
      pos - Block position in level
      sleeper - The sleeping entity.
      Returns:
      True to treat this as a bed
    • getRespawnPosition

      default Optional<net.minecraft.server.level.ServerPlayer.RespawnPosAngle> getRespawnPosition(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.entity.EntityType<?> type, net.minecraft.world.level.LevelReader levelReader, net.minecraft.core.BlockPos pos, float orientation)
      Returns the position that the entity is moved to upon respawning at this block.
      Parameters:
      state - The current state
      type - The entity type used when checking if a dismount blockstate is dangerous. Currently always PLAYER.
      levelReader - The current level
      pos - Block position in level
      orientation - The angle the entity had when setting the respawn point
      Returns:
      The spawn position or the empty optional if respawning here is not possible
    • setBedOccupied

      default void setBedOccupied(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.LivingEntity sleeper, boolean occupied)
      Called when a user either starts or stops sleeping in the bed.
      Parameters:
      level - The current level
      pos - Block position in level
      sleeper - The sleeper or camera entity, null in some cases.
      occupied - True if we are occupying the bed, or false if they are stopping use of the bed
    • getBedDirection

      default net.minecraft.core.Direction getBedDirection(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.LevelReader level, net.minecraft.core.BlockPos pos)
      Returns the direction of the block. Same values that are returned by BlockDirectional. Called every frame tick for every living entity. Be VERY fast.
      Parameters:
      state - The current state
      level - The current level
      pos - Block position in level
      Returns:
      Bed direction
    • getExplosionResistance

      default float getExplosionResistance(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.Explosion explosion)
      Location sensitive version of getExplosionResistance
      Parameters:
      level - The current level
      pos - Block position in level
      explosion - The explosion
      Returns:
      The amount of the explosion absorbed.
    • getCloneItemStack

      default net.minecraft.world.item.ItemStack getCloneItemStack(net.minecraft.world.level.LevelReader level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, boolean includeData, net.minecraft.world.entity.player.Player player)
      Called when A user uses the creative pick block button on this block
      Returns:
      A ItemStack to add to the player's inventory, empty itemstack if nothing should be added.
    • addLandingEffects

      default boolean addLandingEffects(net.minecraft.world.level.block.state.BlockState state1, net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state2, net.minecraft.world.entity.LivingEntity entity, int numberOfParticles)
      Allows a block to override the standard EntityLivingBase.updateFallState particles, this is a server side method that spawns particles with WorldServer.spawnParticle.
      Parameters:
      level - The current server level
      pos - The position of the block.
      state2 - The state at the specific level/pos
      entity - The entity that hit landed on the block
      numberOfParticles - That vanilla level have spawned
      Returns:
      True to prevent vanilla landing particles from spawning
    • addRunningEffects

      default boolean addRunningEffects(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.Entity entity)
      Allows a block to override the standard vanilla running particles. This is called from Entity.spawnSprintParticle and is called both, Client and server side, it's up to the implementor to client check / server check. By default vanilla spawns particles only on the client and the server methods no-op.
      Parameters:
      state - The BlockState the entity is running on.
      level - The level.
      pos - The position at the entities feet.
      entity - The entity running on the block.
      Returns:
      True to prevent vanilla running particles from spawning.
    • canSustainPlant

      default net.minecraft.util.TriState canSustainPlant(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos soilPosition, net.minecraft.core.Direction facing, net.minecraft.world.level.block.state.BlockState plant)
      Determines if this block either force allow or force disallow a plant from being placed on it. (Or pass and let the plant's decision win) This will be called in plant's canSurvive method and/or mayPlace method.
      Parameters:
      state - The current state
      level - The current level
      soilPosition - The current position of the block that will sustain the plant
      facing - The direction relative to the given position the plant wants to be, typically its UP
      plant - The plant that is checking survivability
      Returns:
      TriState.TRUE to allow the plant to be planted/stay. TriState.FALSE to disallow the plant from placing. TriState.DEFAULT to allow the plant to make the decision to stay or not.
    • onTreeGrow

      default boolean onTreeGrow(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.LevelReader level, BiConsumer<net.minecraft.core.BlockPos,net.minecraft.world.level.block.state.BlockState> placeFunction, net.minecraft.util.RandomSource randomSource, net.minecraft.core.BlockPos pos, net.minecraft.world.level.levelgen.feature.configurations.TreeConfiguration config)
      Called when a tree grows on top of this block and tries to set it to dirt by the trunk placer. An override that returns true is responsible for using the place function to set blocks in the world properly during generation. A modded grass block might override this method to ensure it turns into the corresponding modded dirt instead of regular dirt when a tree grows on it. For modded grass blocks, returning true from this method is NOT a substitute for adding your block to the #minecraft:dirt tag, rather for changing the behaviour to something other than setting to dirt. NOTE: This happens DURING world generation, the generation may be incomplete when this is called. Use the placeFunction when modifying the level.
      Parameters:
      state - The current state
      level - The current level
      placeFunction - Function to set blocks in the level for the tree, use this instead of the level directly
      randomSource - The random source
      pos - Position of the block to be set to dirt
      config - Configuration of the trunk placer. Consider azalea trees, which should place rooted dirt instead of regular dirt.
      Returns:
      True to ignore vanilla behaviour
    • isFertile

      default boolean isFertile(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos)
      Checks if this soil is fertile, typically this means that growth rates of plants on this soil will be slightly sped up. Only vanilla case is tilledField when it is within range of water.
      Parameters:
      level - The current level
      pos - Block position in level
      Returns:
      True if the soil should be considered fertile.
    • isConduitFrame

      default boolean isConduitFrame(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.LevelReader level, net.minecraft.core.BlockPos pos, net.minecraft.core.BlockPos conduit)
      Determines if this block can be used as the frame of a conduit.
      Parameters:
      level - The current level
      pos - Block position in level
      conduit - Conduit position in level
      Returns:
      True, to support the conduit, and make it active with this block.
    • isPortalFrame

      default boolean isPortalFrame(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos)
      Determines if this block can be used as part of a frame of a nether portal.
      Parameters:
      state - The current state
      level - The current level
      pos - Block position in level
      Returns:
      True, to support being part of a nether portal frame, false otherwise.
    • getExpDrop

      default int getExpDrop(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.LevelAccessor level, net.minecraft.core.BlockPos pos, @Nullable @Nullable net.minecraft.world.level.block.entity.BlockEntity blockEntity, @Nullable @Nullable net.minecraft.world.entity.Entity breaker, net.minecraft.world.item.ItemStack tool)
      Returns how many experience points this block drops when broken, before application of enchantments.
      Parameters:
      state - The state of the block being broken
      level - The level
      pos - The position of the block being broken
      blockEntity - The block entity, if any
      breaker - The entity who broke the block, if known
      tool - The item stack used to break the block. May be empty
      Returns:
      The amount of experience points dropped by this block
    • rotate

      default net.minecraft.world.level.block.state.BlockState rotate(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.LevelAccessor level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.Rotation direction)
    • getEnchantPowerBonus

      default float getEnchantPowerBonus(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.LevelReader level, net.minecraft.core.BlockPos pos)
      Determines the amount of enchanting power this block can provide to an enchanting table.
      Parameters:
      level - The level
      pos - Block position in level
      Returns:
      The amount of enchanting power this block produces.
    • onNeighborChange

      default void onNeighborChange(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.LevelReader level, net.minecraft.core.BlockPos pos, net.minecraft.core.BlockPos neighbor)
      Called when a block entity on a side of this block changes, is created, or is destroyed.

      This method is not suitable for listening to capability invalidations. For capability invalidations specifically, use BlockCapabilityCache instead.

      Parameters:
      level - The level
      pos - Block position in level
      neighbor - Block position of neighbor
    • shouldCheckWeakPower

      default boolean shouldCheckWeakPower(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.SignalGetter level, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side)
      Called to determine whether to allow the block to handle its own indirect power rather than using the default rules.
      Parameters:
      level - The level
      pos - Block position in level
      side - The INPUT side of the block to be powered - ie the opposite of this block's output side
      Returns:
      Whether Block#isProvidingWeakPower should be called when determining indirect power
    • getWeakChanges

      default boolean getWeakChanges(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.LevelReader level, net.minecraft.core.BlockPos pos)
      If this block should be notified of weak changes. Weak changes are changes 1 block away through a solid block. Similar to comparators.
      Parameters:
      level - The current level
      pos - Block position in level
      Returns:
      true To be notified of changes
    • getSoundType

      default net.minecraft.world.level.block.SoundType getSoundType(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.LevelReader level, net.minecraft.core.BlockPos pos, @Nullable @Nullable net.minecraft.world.entity.Entity entity)
      Sensitive version of getSoundType
      Parameters:
      state - The state
      level - The level
      pos - The position. Note that the level may not necessarily have state here!
      entity - The entity that is breaking/stepping on/placing/hitting/falling on this block, or null if no entity is in this context
      Returns:
      A SoundType to use
    • getBeaconColorMultiplier

      @Nullable default @Nullable Integer getBeaconColorMultiplier(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.LevelReader level, net.minecraft.core.BlockPos pos, net.minecraft.core.BlockPos beaconPos)
      Parameters:
      state - The state
      level - The level
      pos - The position of this state
      beaconPos - The position of the beacon
      Returns:
      An Integer ARGB value to be averaged with a beacon's existing beam color, or null to do nothing to the beam
    • getStateAtViewpoint

      default net.minecraft.world.level.block.state.BlockState getStateAtViewpoint(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.phys.Vec3 viewpoint)
      Used to determine the state 'viewed' by an entity (see
      invalid reference
      Camera#getBlockAtCamera()
      ). Can be used by fluid blocks to determine if the viewpoint is within the fluid or not.
      Parameters:
      state - the state
      level - the level
      pos - the position
      viewpoint - the viewpoint
      Returns:
      the block state that should be 'seen'
    • getBlockPathType

      @Nullable default @Nullable net.minecraft.world.level.pathfinder.PathType getBlockPathType(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, @Nullable @Nullable net.minecraft.world.entity.Mob mob)
      Gets the path type of this block when an entity is pathfinding. When null, uses vanilla behavior.
      Parameters:
      state - the state of the block
      level - the level which contains this block
      pos - the position of the block
      mob - the mob currently pathfinding, may be null
      Returns:
      the path type of this block
    • getAdjacentBlockPathType

      @Nullable default @Nullable net.minecraft.world.level.pathfinder.PathType getAdjacentBlockPathType(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, @Nullable @Nullable net.minecraft.world.entity.Mob mob, net.minecraft.world.level.pathfinder.PathType originalType)
      Gets the path type of the adjacent block to a pathfinding entity. Path types with a negative malus are not traversable for the entity. Pathfinding entities will favor paths consisting of a lower malus. When null, uses vanilla behavior.
      Parameters:
      state - the state of the block
      level - the level which contains this block
      pos - the position of the block
      mob - the mob currently pathfinding, may be null
      originalType - the path type of the source the entity is on
      Returns:
      the path type of this block
    • isSlimeBlock

      default boolean isSlimeBlock(net.minecraft.world.level.block.state.BlockState state)
      Parameters:
      state - The state
      Returns:
      true if the block is sticky block which used for pull or push adjacent blocks (use by piston)
    • isStickyBlock

      default boolean isStickyBlock(net.minecraft.world.level.block.state.BlockState state)
      Parameters:
      state - The state
      Returns:
      true if the block is sticky block which used for pull or push adjacent blocks (use by piston)
    • canStickTo

      default boolean canStickTo(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.block.state.BlockState other)
      Determines if this block can stick to another block when pushed by a piston.
      Parameters:
      state - My state
      other - Other block
      Returns:
      True to link blocks
    • getFlammability

      default int getFlammability(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction direction)
      Chance that fire will spread and consume this block. 300 being a 100% chance, 0, being a 0% chance.
      Parameters:
      state - The current state
      level - The current level
      pos - Block position in level
      direction - The direction that the fire is coming from
      Returns:
      A number ranging from 0 to 300 relating used to determine if the block will be consumed by fire
    • isFlammable

      default boolean isFlammable(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction direction)
      Called when fire is updating, checks if a block face can catch fire.
      Parameters:
      state - The current state
      level - The current level
      pos - Block position in level
      direction - The direction that the fire is coming from
      Returns:
      True if the face can be on fire, false otherwise.
    • onCaughtFire

      default boolean onCaughtFire(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, @Nullable @Nullable net.minecraft.core.Direction direction, @Nullable @Nullable net.minecraft.world.entity.LivingEntity igniter)
      If the block is flammable, this is called when it gets lit on fire.

      The return value determines whether a flint-and-steel in a dispenser was used successfully and should be damaged

      Parameters:
      state - The current state
      level - The current level
      pos - Block position in level
      direction - The direction that the fire is coming from
      igniter - The entity that lit the fire
      Returns:
      whether the block was successfully set on fire (i.e. TNT is allowed to explode and was primed)
    • getFireSpreadSpeed

      default int getFireSpreadSpeed(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction direction)
      Called when fire is updating on a neighbor block. The higher the number returned, the faster fire will spread around this block.
      Parameters:
      state - The current state
      level - The current level
      pos - Block position in level
      direction - The direction that the fire is coming from
      Returns:
      A number that is used to determine the speed of fire growth around the block
    • isFireSource

      default boolean isFireSource(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.LevelReader level, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction direction)
      Currently only called by fire when it is on top of this block. Returning true will prevent the fire from naturally dying during updating. Also prevents firing from dying from rain.
      Parameters:
      state - The current state
      level - The current level
      pos - Block position in level
      direction - The direction that the fire is coming from
      Returns:
      True if this block sustains fire, meaning it will never go out.
    • canEntityDestroy

      default boolean canEntityDestroy(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.Entity entity)
      Determines if this block is can be destroyed by the specified entities normal behavior.
      Parameters:
      state - The current state
      level - The current level
      pos - Block position in level
      Returns:
      True to allow the ender dragon to destroy this block
    • canDropFromExplosion

      default boolean canDropFromExplosion(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.Explosion explosion)
      Determines if this block should drop loot when exploded.
    • onBlockExploded

      default void onBlockExploded(net.minecraft.world.level.block.state.BlockState state, net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.Explosion explosion)
      Called when the block is destroyed by an explosion. Useful for allowing the block to take into account tile entities, state, etc. when exploded, before it is removed.
      Parameters:
      level - The current level
      pos - Block position in level
      explosion - The explosion instance affecting the block
    • collisionExtendsVertically

      default boolean collisionExtendsVertically(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.Entity collidingEntity)
      Determines if this block's collision box should be treated as though it can extend above its block space. Use this to replicate fence and wall behavior.
    • shouldDisplayFluidOverlay

      default boolean shouldDisplayFluidOverlay(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockAndTintGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.material.FluidState fluidState)
      Called to determine whether this block should use the fluid overlay texture or flowing texture when it is placed under the fluid.
      Parameters:
      state - The current state
      level - The level
      pos - Block position in level
      fluidState - The state of the fluid
      Returns:
      Whether the fluid overlay texture should be used
    • getToolModifiedState

      @Nullable default @Nullable net.minecraft.world.level.block.state.BlockState getToolModifiedState(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.item.context.UseOnContext context, ItemAbility itemAbility, boolean simulate)
      Returns the state that this block should transform into when right-clicked by a tool. For example: Used to determine if an axe can strip, a shovel can path, or a hoe can till. Returns null if nothing should happen.
      Parameters:
      state - The current state
      context - The use on context that the action was performed in
      itemAbility - The action being performed by the tool
      simulate - If true, no actions that modify the world in any way should be performed. If false, the world may be modified.
      Returns:
      The resulting state after the action has been performed
    • isScaffolding

      default boolean isScaffolding(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.LevelReader level, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.LivingEntity entity)
      Checks if a player or entity handles movement on this block like scaffolding.
      Parameters:
      state - The current state
      level - The current level
      pos - The block position in level
      entity - The entity on the scaffolding
      Returns:
      True if the block should act like scaffolding
    • canConnectRedstone

      default boolean canConnectRedstone(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, @Nullable @Nullable net.minecraft.core.Direction direction)
      Whether redstone dust should visually connect to this block on a given side

      The default implementation is identical to RedStoneWireBlock#shouldConnectTo(BlockState, Direction)

      RedStoneWireBlock updates its visual connection when

      invalid reference
      BlockState#updateShape(Direction, BlockState, LevelAccessor, BlockPos, BlockPos)
      is called, this callback is used during the evaluation of its new shape.
      Parameters:
      state - The current state
      level - The level
      pos - The block position in level
      direction - The coming direction of the redstone dust connection (with respect to the block at pos)
      Returns:
      True if redstone dust should visually connect on the side passed

      If the return value is evaluated based on level and pos (e.g. from BlockEntity), then the implementation of this block should notify its neighbors to update their shapes when necessary. Consider using BlockBehaviour.BlockStateBase.updateNeighbourShapes(LevelAccessor, BlockPos, int, int) or

      invalid reference
      BlockState#updateShape(Direction, BlockState, LevelAccessor, BlockPos, BlockPos)
      .

      Example:

      1. yourBlockState.updateNeighbourShapes(level, yourBlockPos, UPDATE_ALL);

      2. neighborState.updateShape(fromDirection, stateOfYourBlock, level, neighborBlockPos, yourBlockPos), where fromDirection is defined from the neighbor block's point of view.

    • hidesNeighborFace

      default boolean hidesNeighborFace(net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.block.state.BlockState neighborState, net.minecraft.core.Direction dir)
      Whether this block hides the neighbors face pointed towards by the given direction.

      This method should only be used for blocks you don't control, for your own blocks override BlockBehaviour.skipRendering(BlockState, BlockState, Direction) on the respective block instead

      Note that this method may be called on any of the client's meshing threads.
      As such, if you need any data from your BlockEntity, you should put it in ModelData to guarantee safe concurrent access to it on the client.
      IBlockGetterExtension.getModelData(BlockPos) will return the ModelData for the queried block, or ModelData.EMPTY if none is present.

      Parameters:
      level - The world
      pos - The blocks position in the world
      state - The blocks BlockState
      neighborState - The neighboring blocks BlockState
      dir - The direction towards the neighboring block
    • supportsExternalFaceHiding

      default boolean supportsExternalFaceHiding(net.minecraft.world.level.block.state.BlockState state)
      Whether this block allows a neighboring block to hide the face of this block it touches. If this returns true, IBlockStateExtension.hidesNeighborFace(BlockGetter, BlockPos, BlockState, Direction) will be called on the neighboring block.
    • onBlockStateChange

      default void onBlockStateChange(net.minecraft.world.level.LevelReader level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState oldState, net.minecraft.world.level.block.state.BlockState newState)
      Called after the BlockState at the given BlockPos was changed and neighbors were updated. This method is called on the server and client side. Modifying the level is disallowed in this method. Useful for calculating additional data based on the new state and the neighbor's reactions to the state change.
      Parameters:
      level - The level the state was modified in
      pos - The blocks position in the level
      oldState - The previous state of the block at the given position, may be a different block than this one
      newState - The new state of the block at the given position
    • canBeHydrated

      default boolean canBeHydrated(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter getter, net.minecraft.core.BlockPos pos, net.minecraft.world.level.material.FluidState fluid, net.minecraft.core.BlockPos fluidPos)
      Returns whether the block can be hydrated by a fluid.

      Hydration is an arbitrary word which depends on the block.

      • A farmland has moisture
      • A sponge can soak up the liquid
      • A coral can live
      Parameters:
      state - the state of the block being hydrated
      getter - the getter which can get the block
      pos - the position of the block being hydrated
      fluid - the state of the fluid
      fluidPos - the position of the fluid
      Returns:
      true if the block can be hydrated, false otherwise
    • getMapColor

      default net.minecraft.world.level.material.MapColor getMapColor(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.material.MapColor defaultColor)
      Returns the MapColor shown on the map.
      Parameters:
      state - The state of this block
      level - The level this block is in
      pos - The blocks position in the level
      defaultColor - The MapColor configured for the given BlockState in the BlockBehaviour.Properties
    • getAppearance

      default net.minecraft.world.level.block.state.BlockState getAppearance(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockAndTintGetter level, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side, @Nullable @Nullable net.minecraft.world.level.block.state.BlockState queryState, @Nullable @Nullable net.minecraft.core.BlockPos queryPos)
      Returns the BlockState that this block reports to look like on the given side, for querying by other mods. Note: Overriding this does not change how this block renders. That must still be handled in the block's model.

      Common implementors would be covers and facades, or any other mimic blocks that proxy another block's model. Common consumers would be models with connected textures that wish to seamlessly connect to mimic blocks.

      Note that this method may be called on the server, or on any of the client's meshing threads.
      As such, if you need any data from your BlockEntity, you should put it in ModelData to guarantee safe concurrent access to it on the client.
      Calling ILevelExtension.getModelDataManager() will return null if in a server context, where it is safe to query your BlockEntity directly. Otherwise, IBlockGetterExtension.getModelData(BlockPos) will return the ModelData for the queried block, or ModelData.EMPTY if none is present.

      Parameters:
      state - The state of this block
      level - The level this block is in
      pos - The block's position in the level
      side - The side of the block that is being queried
      queryState - The state of the block that is querying the appearance, or null if not applicable
      queryPos - The position of the block that is querying the appearance, or null if not applicable
      Returns:
      The appearance of this block on the given side. By default, the current state
      See Also:
    • getPistonPushReaction

      @Nullable default @Nullable net.minecraft.world.level.material.PushReaction getPistonPushReaction(net.minecraft.world.level.block.state.BlockState state)
      Returns the reaction of the block when pushed or pulled by a piston. This method should be not called directly, instead via BlockBehaviour.BlockStateBase.getPistonPushReaction().
      • NORMAL: is pushable and pullable by sticky pistons
      • DESTROY: is being destroyed on pushing and pulling
      • BLOCK: is not being able to be moved
      • IGNORE: only usable by entities
      • PUSH_ONLY: can only be pushed, blocks on trying to be pulled
      • null: use the PistonPushReaction from the BlockBehaviour.Properties passed into the Block Constructor
      Parameters:
      state - The state of this block
      Returns:
      the PushReaction of this state or null if the one passed into the block properties should be used
    • isEmpty

      default boolean isEmpty(net.minecraft.world.level.block.state.BlockState state)
      Return true if the state is able to be replaced with Blocks.AIR in chunk sections that is entirely made of blocks that return true for isEmpty
      Parameters:
      state - The current state
      Returns:
      True if the block should be allowed to be optimized away into Blocks.AIR
    • getBubbleColumnDirection

      default BubbleColumnDirection getBubbleColumnDirection(net.minecraft.world.level.block.state.BlockState state)
      Determines if this block can spawn Bubble Columns and if so, what direction the column flows.

      NOTE: The block itself will still need to call BubbleColumnBlock.updateColumn(LevelAccessor, BlockPos, BlockState) in their tick method and schedule a block tick in the block's onPlace. Also, schedule a fluid tick in updateShape method if update direction is up. Both are needed in order to get the Bubble Columns to function properly. See SoulSandBlock and MagmaBlock for example.

      Parameters:
      state - The current state
      Returns:
      BubbleColumnDirection.NONE for no Bubble Column. Otherwise, will spawn Bubble Column flowing with specified direction
    • shouldHideAdjacentFluidFace

      default boolean shouldHideAdjacentFluidFace(net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.Direction selfFace, net.minecraft.world.level.material.FluidState adjacentFluid)
      Determines if a fluid adjacent to the block on the given side should not be rendered.
      Parameters:
      state - the block state of the block
      selfFace - the face of this block that the fluid is adjacent to
      adjacentFluid - the fluid that is touching that face
      Returns:
      true if this block should cause the fluid's face to not render