Class FabricBlockSettings

java.lang.Object
net.minecraft.block.AbstractBlock.Settings
net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings

public class FabricBlockSettings extends net.minecraft.block.AbstractBlock.Settings
Fabric's version of Block.Settings. Adds additional methods and hooks not found in the original class.

To use it, simply replace Block.Settings.of() with FabricBlockSettings.of().

  • Constructor Details

    • FabricBlockSettings

      protected FabricBlockSettings(net.minecraft.block.Material material, net.minecraft.block.MapColor color)
    • FabricBlockSettings

      protected FabricBlockSettings(net.minecraft.block.AbstractBlock.Settings settings)
  • Method Details

    • of

      public static FabricBlockSettings of(net.minecraft.block.Material material)
    • of

      public static FabricBlockSettings of(net.minecraft.block.Material material, net.minecraft.block.MapColor color)
    • of

      public static FabricBlockSettings of(net.minecraft.block.Material material, net.minecraft.util.DyeColor color)
    • copyOf

      public static FabricBlockSettings copyOf(net.minecraft.block.AbstractBlock block)
    • copyOf

      public static FabricBlockSettings copyOf(net.minecraft.block.AbstractBlock.Settings settings)
    • noCollision

      public FabricBlockSettings noCollision()
      Overrides:
      noCollision in class net.minecraft.block.AbstractBlock.Settings
    • nonOpaque

      public FabricBlockSettings nonOpaque()
      Overrides:
      nonOpaque in class net.minecraft.block.AbstractBlock.Settings
    • slipperiness

      public FabricBlockSettings slipperiness(float value)
      Overrides:
      slipperiness in class net.minecraft.block.AbstractBlock.Settings
    • velocityMultiplier

      public FabricBlockSettings velocityMultiplier(float velocityMultiplier)
      Overrides:
      velocityMultiplier in class net.minecraft.block.AbstractBlock.Settings
    • jumpVelocityMultiplier

      public FabricBlockSettings jumpVelocityMultiplier(float jumpVelocityMultiplier)
      Overrides:
      jumpVelocityMultiplier in class net.minecraft.block.AbstractBlock.Settings
    • sounds

      public FabricBlockSettings sounds(net.minecraft.sound.BlockSoundGroup group)
      Overrides:
      sounds in class net.minecraft.block.AbstractBlock.Settings
    • lightLevel

      public FabricBlockSettings lightLevel(ToIntFunction<net.minecraft.block.BlockState> levelFunction)
      Deprecated.
    • luminance

      public FabricBlockSettings luminance(ToIntFunction<net.minecraft.block.BlockState> luminanceFunction)
      Overrides:
      luminance in class net.minecraft.block.AbstractBlock.Settings
    • strength

      public FabricBlockSettings strength(float hardness, float resistance)
      Overrides:
      strength in class net.minecraft.block.AbstractBlock.Settings
    • breakInstantly

      public FabricBlockSettings breakInstantly()
      Overrides:
      breakInstantly in class net.minecraft.block.AbstractBlock.Settings
    • strength

      public FabricBlockSettings strength(float strength)
      Overrides:
      strength in class net.minecraft.block.AbstractBlock.Settings
    • ticksRandomly

      public FabricBlockSettings ticksRandomly()
      Overrides:
      ticksRandomly in class net.minecraft.block.AbstractBlock.Settings
    • dynamicBounds

      public FabricBlockSettings dynamicBounds()
      Overrides:
      dynamicBounds in class net.minecraft.block.AbstractBlock.Settings
    • dropsNothing

      public FabricBlockSettings dropsNothing()
      Overrides:
      dropsNothing in class net.minecraft.block.AbstractBlock.Settings
    • dropsLike

      public FabricBlockSettings dropsLike(net.minecraft.block.Block block)
      Overrides:
      dropsLike in class net.minecraft.block.AbstractBlock.Settings
    • air

      public FabricBlockSettings air()
      Overrides:
      air in class net.minecraft.block.AbstractBlock.Settings
    • allowsSpawning

      public FabricBlockSettings allowsSpawning(net.minecraft.block.AbstractBlock.TypedContextPredicate<net.minecraft.entity.EntityType<?>> predicate)
      Overrides:
      allowsSpawning in class net.minecraft.block.AbstractBlock.Settings
    • solidBlock

      public FabricBlockSettings solidBlock(net.minecraft.block.AbstractBlock.ContextPredicate predicate)
      Overrides:
      solidBlock in class net.minecraft.block.AbstractBlock.Settings
    • suffocates

      public FabricBlockSettings suffocates(net.minecraft.block.AbstractBlock.ContextPredicate predicate)
      Overrides:
      suffocates in class net.minecraft.block.AbstractBlock.Settings
    • blockVision

      public FabricBlockSettings blockVision(net.minecraft.block.AbstractBlock.ContextPredicate predicate)
      Overrides:
      blockVision in class net.minecraft.block.AbstractBlock.Settings
    • postProcess

      public FabricBlockSettings postProcess(net.minecraft.block.AbstractBlock.ContextPredicate predicate)
      Overrides:
      postProcess in class net.minecraft.block.AbstractBlock.Settings
    • emissiveLighting

      public FabricBlockSettings emissiveLighting(net.minecraft.block.AbstractBlock.ContextPredicate predicate)
      Overrides:
      emissiveLighting in class net.minecraft.block.AbstractBlock.Settings
    • lightLevel

      @Deprecated public FabricBlockSettings lightLevel(int lightLevel)
      Deprecated.
      Please use luminance(int).
    • luminance

      public FabricBlockSettings luminance(int luminance)
    • hardness

      public FabricBlockSettings hardness(float hardness)
      Overrides:
      hardness in class net.minecraft.block.AbstractBlock.Settings
    • resistance

      public FabricBlockSettings resistance(float resistance)
      Overrides:
      resistance in class net.minecraft.block.AbstractBlock.Settings
    • drops

      public FabricBlockSettings drops(net.minecraft.util.Identifier dropTableId)
    • requiresTool

      public FabricBlockSettings requiresTool()
      Make the block require tool to drop and slows down mining speed if the incorrect tool is used.
      Overrides:
      requiresTool in class net.minecraft.block.AbstractBlock.Settings
    • materialColor

      @Deprecated public FabricBlockSettings materialColor(net.minecraft.block.MapColor color)
      Deprecated.
      Please migrate to mapColor(MapColor)
    • materialColor

      @Deprecated public FabricBlockSettings materialColor(net.minecraft.util.DyeColor color)
      Deprecated.
      Please migrate to mapColor(DyeColor)
    • mapColor

      public FabricBlockSettings mapColor(net.minecraft.block.MapColor color)
      Overrides:
      mapColor in class net.minecraft.block.AbstractBlock.Settings
    • mapColor

      public FabricBlockSettings mapColor(net.minecraft.util.DyeColor color)
    • collidable

      public FabricBlockSettings collidable(boolean collidable)
    • breakByHand

      public FabricBlockSettings breakByHand(boolean breakByHand)
      Makes the block breakable by any tool if breakByHand is set to true.
    • breakByTool

      @Deprecated(forRemoval=true) public FabricBlockSettings breakByTool(net.minecraft.tag.Tag<net.minecraft.item.Item> tag, int miningLevel)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Replaced by mineable tags. See fabric-mining-level-api-v1 for further details.
      Please make the block require a tool if you plan to disable drops and slow the breaking down using the incorrect tool by using requiresTool().
    • breakByTool

      @Deprecated(forRemoval=true) public FabricBlockSettings breakByTool(net.minecraft.tag.Tag<net.minecraft.item.Item> tag)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Replaced by mineable tags. See fabric-mining-level-api-v1 for further details.S
      Please make the block require a tool if you plan to disable drops and slow the breaking down using the incorrect tool by using requiresTool().