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 Summary
ModifierConstructorDescriptionprotected
FabricBlockSettings(net.minecraft.block.AbstractBlock.Settings settings)
protected
FabricBlockSettings(net.minecraft.block.Material material, net.minecraft.block.MaterialColor color)
-
Method Summary
Modifier and TypeMethodDescriptionair()
allowsSpawning(net.minecraft.block.AbstractBlock.TypedContextPredicate<net.minecraft.entity.EntityType<?>> predicate)
blockVision(net.minecraft.block.AbstractBlock.ContextPredicate predicate)
breakByHand(boolean breakByHand)
Makes the block breakable by any tool ifbreakByHand
is set to true.breakByTool(net.minecraft.tag.Tag<net.minecraft.item.Item> tag)
Please make the block require a tool if you plan to disable drops and slow the breaking down using the incorrect tool by usingrequiresTool()
.breakByTool(net.minecraft.tag.Tag<net.minecraft.item.Item> tag, int miningLevel)
Please make the block require a tool if you plan to disable drops and slow the breaking down using the incorrect tool by usingrequiresTool()
.collidable(boolean collidable)
static FabricBlockSettings
copyOf(net.minecraft.block.AbstractBlock block)
static FabricBlockSettings
copyOf(net.minecraft.block.AbstractBlock.Settings settings)
drops(net.minecraft.util.Identifier dropTableId)
dropsLike(net.minecraft.block.Block block)
emissiveLighting(net.minecraft.block.AbstractBlock.ContextPredicate predicate)
hardness(float hardness)
jumpVelocityMultiplier(float jumpVelocityMultiplier)
lightLevel(int lightLevel)
Deprecated.lightLevel(ToIntFunction<net.minecraft.block.BlockState> levelFunction)
Deprecated.Please useluminance(ToIntFunction)
.luminance(int luminance)
luminance(ToIntFunction<net.minecraft.block.BlockState> luminanceFunction)
materialColor(net.minecraft.block.MaterialColor color)
materialColor(net.minecraft.util.DyeColor color)
static FabricBlockSettings
of(net.minecraft.block.Material material)
static FabricBlockSettings
of(net.minecraft.block.Material material, net.minecraft.block.MaterialColor color)
static FabricBlockSettings
of(net.minecraft.block.Material material, net.minecraft.util.DyeColor color)
postProcess(net.minecraft.block.AbstractBlock.ContextPredicate predicate)
Make the block require tool to drop and slows down mining speed if the incorrect tool is used.resistance(float resistance)
slipperiness(float value)
solidBlock(net.minecraft.block.AbstractBlock.ContextPredicate predicate)
sounds(net.minecraft.sound.BlockSoundGroup group)
strength(float strength)
strength(float hardness, float resistance)
suffocates(net.minecraft.block.AbstractBlock.ContextPredicate predicate)
velocityMultiplier(float velocityMultiplier)
Methods inherited from class net.minecraft.block.AbstractBlock.Settings
copy, of
-
Constructor Details
-
FabricBlockSettings
protected FabricBlockSettings(net.minecraft.block.Material material, net.minecraft.block.MaterialColor color) -
FabricBlockSettings
protected FabricBlockSettings(net.minecraft.block.AbstractBlock.Settings settings)
-
-
Method Details
-
of
-
of
public static FabricBlockSettings of(net.minecraft.block.Material material, net.minecraft.block.MaterialColor color) -
of
public static FabricBlockSettings of(net.minecraft.block.Material material, net.minecraft.util.DyeColor color) -
copyOf
-
copyOf
-
noCollision
- Overrides:
noCollision
in classnet.minecraft.block.AbstractBlock.Settings
-
nonOpaque
- Overrides:
nonOpaque
in classnet.minecraft.block.AbstractBlock.Settings
-
slipperiness
- Overrides:
slipperiness
in classnet.minecraft.block.AbstractBlock.Settings
-
velocityMultiplier
- Overrides:
velocityMultiplier
in classnet.minecraft.block.AbstractBlock.Settings
-
jumpVelocityMultiplier
- Overrides:
jumpVelocityMultiplier
in classnet.minecraft.block.AbstractBlock.Settings
-
sounds
- Overrides:
sounds
in classnet.minecraft.block.AbstractBlock.Settings
-
lightLevel
Deprecated.Please useluminance(ToIntFunction)
. -
luminance
public FabricBlockSettings luminance(ToIntFunction<net.minecraft.block.BlockState> luminanceFunction)- Overrides:
luminance
in classnet.minecraft.block.AbstractBlock.Settings
-
strength
- Overrides:
strength
in classnet.minecraft.block.AbstractBlock.Settings
-
breakInstantly
- Overrides:
breakInstantly
in classnet.minecraft.block.AbstractBlock.Settings
-
strength
- Overrides:
strength
in classnet.minecraft.block.AbstractBlock.Settings
-
ticksRandomly
- Overrides:
ticksRandomly
in classnet.minecraft.block.AbstractBlock.Settings
-
dynamicBounds
- Overrides:
dynamicBounds
in classnet.minecraft.block.AbstractBlock.Settings
-
dropsNothing
- Overrides:
dropsNothing
in classnet.minecraft.block.AbstractBlock.Settings
-
dropsLike
- Overrides:
dropsLike
in classnet.minecraft.block.AbstractBlock.Settings
-
air
- Overrides:
air
in classnet.minecraft.block.AbstractBlock.Settings
-
allowsSpawning
public FabricBlockSettings allowsSpawning(net.minecraft.block.AbstractBlock.TypedContextPredicate<net.minecraft.entity.EntityType<?>> predicate)- Overrides:
allowsSpawning
in classnet.minecraft.block.AbstractBlock.Settings
-
solidBlock
public FabricBlockSettings solidBlock(net.minecraft.block.AbstractBlock.ContextPredicate predicate)- Overrides:
solidBlock
in classnet.minecraft.block.AbstractBlock.Settings
-
suffocates
public FabricBlockSettings suffocates(net.minecraft.block.AbstractBlock.ContextPredicate predicate)- Overrides:
suffocates
in classnet.minecraft.block.AbstractBlock.Settings
-
blockVision
public FabricBlockSettings blockVision(net.minecraft.block.AbstractBlock.ContextPredicate predicate)- Overrides:
blockVision
in classnet.minecraft.block.AbstractBlock.Settings
-
postProcess
public FabricBlockSettings postProcess(net.minecraft.block.AbstractBlock.ContextPredicate predicate)- Overrides:
postProcess
in classnet.minecraft.block.AbstractBlock.Settings
-
emissiveLighting
public FabricBlockSettings emissiveLighting(net.minecraft.block.AbstractBlock.ContextPredicate predicate)- Overrides:
emissiveLighting
in classnet.minecraft.block.AbstractBlock.Settings
-
lightLevel
Deprecated.Please useluminance(int)
. -
luminance
-
hardness
-
resistance
-
drops
-
requiresTool
Make the block require tool to drop and slows down mining speed if the incorrect tool is used.- Overrides:
requiresTool
in classnet.minecraft.block.AbstractBlock.Settings
-
materialColor
-
materialColor
-
collidable
-
breakByHand
Makes the block breakable by any tool ifbreakByHand
is set to true. -
breakByTool
public FabricBlockSettings breakByTool(net.minecraft.tag.Tag<net.minecraft.item.Item> tag, int miningLevel)Please make the block require a tool if you plan to disable drops and slow the breaking down using the incorrect tool by usingrequiresTool()
. -
breakByTool
Please make the block require a tool if you plan to disable drops and slow the breaking down using the incorrect tool by usingrequiresTool()
.
-
luminance(int)
.