Class FabricBlockSettings
java.lang.Object
net.minecraft.block.AbstractBlock.Settings
net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings
Fabric's version of Block.Settings. Adds additional methods and hooks
not found in the original class.
Make note that this behaves slightly different from the vanilla counterpart, copying some settings that vanilla does not.
To use it, simply replace Block.Settings.of() with FabricBlockSettings.of().
-
Constructor Summary
ModifierConstructorDescriptionprotected
FabricBlockSettings
(AbstractBlock.Settings settings) protected
FabricBlockSettings
(Material material, Function<BlockState, MapColor> mapColorProvider) protected
FabricBlockSettings
(Material material, MapColor color) -
Method Summary
Modifier and TypeMethodDescriptionair()
allowsSpawning
(AbstractBlock.TypedContextPredicate<EntityType<?>> predicate) blockVision
(AbstractBlock.ContextPredicate predicate) collidable
(boolean collidable) static FabricBlockSettings
copyOf
(AbstractBlock block) static FabricBlockSettings
copyOf
(AbstractBlock.Settings settings) drops
(Identifier dropTableId) emissiveLighting
(AbstractBlock.ContextPredicate predicate) hardness
(float hardness) jumpVelocityMultiplier
(float jumpVelocityMultiplier) lightLevel
(int lightLevel) Deprecated.lightLevel
(ToIntFunction<BlockState> levelFunction) Deprecated.Please useluminance(ToIntFunction)
.luminance
(int luminance) luminance
(ToIntFunction<BlockState> luminanceFunction) materialColor
(MapColor color) Deprecated.Please migrate tomapColor(MapColor)
materialColor
(DyeColor color) Deprecated.Please migrate tomapColor(DyeColor)
static FabricBlockSettings
static FabricBlockSettings
of
(Material material, Function<BlockState, MapColor> mapColor) static FabricBlockSettings
static FabricBlockSettings
offsetType
(Function<BlockState, AbstractBlock.OffsetType> offsetType) offsetType
(AbstractBlock.OffsetType offsetType) postProcess
(AbstractBlock.ContextPredicate predicate) requires
(FeatureFlag... features) 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
(AbstractBlock.ContextPredicate predicate) sounds
(BlockSoundGroup group) strength
(float strength) strength
(float hardness, float resistance) suffocates
(AbstractBlock.ContextPredicate predicate) velocityMultiplier
(float velocityMultiplier) Methods inherited from class net.minecraft.block.AbstractBlock.Settings
copy
-
Constructor Details
-
FabricBlockSettings
-
FabricBlockSettings
-
FabricBlockSettings
-
-
Method Details
-
of
-
of
-
of
-
of
-
copyOf
-
copyOf
-
noCollision
- Overrides:
noCollision
in classAbstractBlock.Settings
-
nonOpaque
- Overrides:
nonOpaque
in classAbstractBlock.Settings
-
slipperiness
- Overrides:
slipperiness
in classAbstractBlock.Settings
-
velocityMultiplier
- Overrides:
velocityMultiplier
in classAbstractBlock.Settings
-
jumpVelocityMultiplier
- Overrides:
jumpVelocityMultiplier
in classAbstractBlock.Settings
-
sounds
- Overrides:
sounds
in classAbstractBlock.Settings
-
lightLevel
Deprecated.Please useluminance(ToIntFunction)
. -
luminance
- Overrides:
luminance
in classAbstractBlock.Settings
-
strength
- Overrides:
strength
in classAbstractBlock.Settings
-
breakInstantly
- Overrides:
breakInstantly
in classAbstractBlock.Settings
-
strength
- Overrides:
strength
in classAbstractBlock.Settings
-
ticksRandomly
- Overrides:
ticksRandomly
in classAbstractBlock.Settings
-
dynamicBounds
- Overrides:
dynamicBounds
in classAbstractBlock.Settings
-
dropsNothing
- Overrides:
dropsNothing
in classAbstractBlock.Settings
-
dropsLike
- Overrides:
dropsLike
in classAbstractBlock.Settings
-
air
- Overrides:
air
in classAbstractBlock.Settings
-
allowsSpawning
public FabricBlockSettings allowsSpawning(AbstractBlock.TypedContextPredicate<EntityType<?>> predicate) - Overrides:
allowsSpawning
in classAbstractBlock.Settings
-
solidBlock
- Overrides:
solidBlock
in classAbstractBlock.Settings
-
suffocates
- Overrides:
suffocates
in classAbstractBlock.Settings
-
blockVision
- Overrides:
blockVision
in classAbstractBlock.Settings
-
postProcess
- Overrides:
postProcess
in classAbstractBlock.Settings
-
emissiveLighting
- Overrides:
emissiveLighting
in classAbstractBlock.Settings
-
requiresTool
Make the block require tool to drop and slows down mining speed if the incorrect tool is used.- Overrides:
requiresTool
in classAbstractBlock.Settings
-
mapColor
- Overrides:
mapColor
in classAbstractBlock.Settings
-
hardness
- Overrides:
hardness
in classAbstractBlock.Settings
-
resistance
- Overrides:
resistance
in classAbstractBlock.Settings
-
offsetType
- Overrides:
offsetType
in classAbstractBlock.Settings
-
offsetType
- Overrides:
offsetType
in classAbstractBlock.Settings
-
noBlockBreakParticles
- Overrides:
noBlockBreakParticles
in classAbstractBlock.Settings
-
requires
- Overrides:
requires
in classAbstractBlock.Settings
-
lightLevel
Deprecated.Please useluminance(int)
. -
luminance
-
drops
-
materialColor
Deprecated.Please migrate tomapColor(MapColor)
-
materialColor
Deprecated.Please migrate tomapColor(DyeColor)
-
mapColor
-
collidable
-
luminance(int)
.