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
ConstructorsModifierConstructorDescriptionprotectedFabricBlockSettings(net.minecraft.block.AbstractBlock.Settings settings)protectedFabricBlockSettings(net.minecraft.block.Material material, net.minecraft.block.MapColor 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 ifbreakByHandis 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 FabricBlockSettingscopyOf(net.minecraft.block.AbstractBlock block)static FabricBlockSettingscopyOf(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)mapColor(net.minecraft.block.MapColor color)mapColor(net.minecraft.util.DyeColor color)materialColor(net.minecraft.block.MapColor color)Deprecated.Please migrate tomapColor(MapColor)materialColor(net.minecraft.util.DyeColor color)Deprecated.Please migrate tomapColor(DyeColor)static FabricBlockSettingsof(net.minecraft.block.Material material)static FabricBlockSettingsof(net.minecraft.block.Material material, net.minecraft.block.MapColor color)static FabricBlockSettingsof(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.MapColor 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.MapColor color) -
of
public static FabricBlockSettings of(net.minecraft.block.Material material, net.minecraft.util.DyeColor color) -
copyOf
-
copyOf
-
noCollision
- Overrides:
noCollisionin classnet.minecraft.block.AbstractBlock.Settings
-
nonOpaque
- Overrides:
nonOpaquein classnet.minecraft.block.AbstractBlock.Settings
-
slipperiness
- Overrides:
slipperinessin classnet.minecraft.block.AbstractBlock.Settings
-
velocityMultiplier
- Overrides:
velocityMultiplierin classnet.minecraft.block.AbstractBlock.Settings
-
jumpVelocityMultiplier
- Overrides:
jumpVelocityMultiplierin classnet.minecraft.block.AbstractBlock.Settings
-
sounds
- Overrides:
soundsin classnet.minecraft.block.AbstractBlock.Settings
-
lightLevel
Deprecated.Please useluminance(ToIntFunction). -
luminance
public FabricBlockSettings luminance(ToIntFunction<net.minecraft.block.BlockState> luminanceFunction)- Overrides:
luminancein classnet.minecraft.block.AbstractBlock.Settings
-
strength
- Overrides:
strengthin classnet.minecraft.block.AbstractBlock.Settings
-
breakInstantly
- Overrides:
breakInstantlyin classnet.minecraft.block.AbstractBlock.Settings
-
strength
- Overrides:
strengthin classnet.minecraft.block.AbstractBlock.Settings
-
ticksRandomly
- Overrides:
ticksRandomlyin classnet.minecraft.block.AbstractBlock.Settings
-
dynamicBounds
- Overrides:
dynamicBoundsin classnet.minecraft.block.AbstractBlock.Settings
-
dropsNothing
- Overrides:
dropsNothingin classnet.minecraft.block.AbstractBlock.Settings
-
dropsLike
- Overrides:
dropsLikein classnet.minecraft.block.AbstractBlock.Settings
-
air
- Overrides:
airin classnet.minecraft.block.AbstractBlock.Settings
-
allowsSpawning
public FabricBlockSettings allowsSpawning(net.minecraft.block.AbstractBlock.TypedContextPredicate<net.minecraft.entity.EntityType<?>> predicate)- Overrides:
allowsSpawningin classnet.minecraft.block.AbstractBlock.Settings
-
solidBlock
public FabricBlockSettings solidBlock(net.minecraft.block.AbstractBlock.ContextPredicate predicate)- Overrides:
solidBlockin classnet.minecraft.block.AbstractBlock.Settings
-
suffocates
public FabricBlockSettings suffocates(net.minecraft.block.AbstractBlock.ContextPredicate predicate)- Overrides:
suffocatesin classnet.minecraft.block.AbstractBlock.Settings
-
blockVision
public FabricBlockSettings blockVision(net.minecraft.block.AbstractBlock.ContextPredicate predicate)- Overrides:
blockVisionin classnet.minecraft.block.AbstractBlock.Settings
-
postProcess
public FabricBlockSettings postProcess(net.minecraft.block.AbstractBlock.ContextPredicate predicate)- Overrides:
postProcessin classnet.minecraft.block.AbstractBlock.Settings
-
emissiveLighting
public FabricBlockSettings emissiveLighting(net.minecraft.block.AbstractBlock.ContextPredicate predicate)- Overrides:
emissiveLightingin classnet.minecraft.block.AbstractBlock.Settings
-
lightLevel
Deprecated.Please useluminance(int). -
luminance
-
hardness
- Overrides:
hardnessin classnet.minecraft.block.AbstractBlock.Settings
-
resistance
- Overrides:
resistancein classnet.minecraft.block.AbstractBlock.Settings
-
drops
-
requiresTool
Make the block require tool to drop and slows down mining speed if the incorrect tool is used.- Overrides:
requiresToolin classnet.minecraft.block.AbstractBlock.Settings
-
materialColor
Deprecated.Please migrate tomapColor(MapColor) -
materialColor
Deprecated.Please migrate tomapColor(DyeColor) -
mapColor
- Overrides:
mapColorin classnet.minecraft.block.AbstractBlock.Settings
-
mapColor
-
collidable
-
breakByHand
Makes the block breakable by any tool ifbreakByHandis 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).