Class BlockSetTypeBuilder
BlockSetTypes.
A BlockSetType is used to tell the game various properties of related blocks, such as what sounds they should use.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.level.block.state.properties.BlockSetTypebuild(net.minecraft.resources.Identifier id) Builds aBlockSetTypefrom this builder's values without registering it.buttonActivatedByArrows(boolean buttonActivatedByArrows) Sets whether this block set type's button can be activated by an arrow.buttonClickOffSound(net.minecraft.sounds.SoundEvent buttonClickOffSound) Sets this block set type's button click off sound.buttonClickOnSound(net.minecraft.sounds.SoundEvent buttonClickOnSound) Sets this block set type's button click on sound.static BlockSetTypeBuildercopyOf(BlockSetTypeBuilder builder) Creates a newBlockSetTypeBuilderthat copies all of another builder's values.static BlockSetTypeBuildercopyOf(net.minecraft.world.level.block.state.properties.BlockSetType setType) Creates a newBlockSetTypeBuilderthat copies all of another block set type's values.doorCloseSound(net.minecraft.sounds.SoundEvent doorCloseSound) Sets this block set type's door close sound.doorOpenSound(net.minecraft.sounds.SoundEvent doorOpenSound) Sets this block set type's door open sound.openableByHand(boolean openableByHand) Sets whether this block set type's door and trapdoor can be opened by hand.openableByWindCharge(boolean openableByWindCharge) Sets whether this block set type's door and trapdoor can be opened by wind charge.pressurePlateActivationRule(net.minecraft.world.level.block.state.properties.BlockSetType.PressurePlateSensitivity activationRule) Sets this block set type's pressure plateBlockSetType.PressurePlateSensitivity.pressurePlateClickOffSound(net.minecraft.sounds.SoundEvent pressurePlateClickOffSound) Sets this block set type's pressure plate click off sound.pressurePlateClickOnSound(net.minecraft.sounds.SoundEvent pressurePlateClickOnSound) Sets this block set type's pressure plate click on sound.net.minecraft.world.level.block.state.properties.BlockSetTyperegister(net.minecraft.resources.Identifier id) Builds and registers aBlockSetTypefrom this builder's values.soundType(net.minecraft.world.level.block.SoundType soundType) Sets this block set type's sound type.trapdoorCloseSound(net.minecraft.sounds.SoundEvent trapdoorCloseSound) Sets this block set type's trapdoor close sound.trapdoorOpenSound(net.minecraft.sounds.SoundEvent trapdoorOpenSound) Sets this block set type's trapdoor open sound.
-
Constructor Details
-
BlockSetTypeBuilder
public BlockSetTypeBuilder()
-
-
Method Details
-
openableByHand
Sets whether this block set type's door and trapdoor can be opened by hand.Defaults to
true.- Returns:
- this builder for chaining
-
openableByWindCharge
Sets whether this block set type's door and trapdoor can be opened by wind charge.Defaults to
true.- Returns:
- this builder for chaining
-
buttonActivatedByArrows
Sets whether this block set type's button can be activated by an arrow.Defaults to
true.- Returns:
- this builder for chaining
-
pressurePlateActivationRule
public BlockSetTypeBuilder pressurePlateActivationRule(net.minecraft.world.level.block.state.properties.BlockSetType.PressurePlateSensitivity activationRule) Sets this block set type's pressure plateBlockSetType.PressurePlateSensitivity.Defaults to
BlockSetType.PressurePlateSensitivity.EVERYTHING.- Returns:
- this builder for chaining
-
soundType
Sets this block set type's sound type.Defaults to
SoundType.WOOD.- Returns:
- this builder for chaining
-
doorCloseSound
Sets this block set type's door close sound.Defaults to
SoundEvents.WOODEN_DOOR_CLOSE.- Returns:
- this builder for chaining
-
doorOpenSound
Sets this block set type's door open sound.Defaults to
SoundEvents.WOODEN_DOOR_OPEN.- Returns:
- this builder for chaining
-
trapdoorCloseSound
Sets this block set type's trapdoor close sound.Defaults to
SoundEvents.WOODEN_TRAPDOOR_CLOSE.- Returns:
- this builder for chaining
-
trapdoorOpenSound
Sets this block set type's trapdoor open sound.Defaults to
SoundEvents.WOODEN_TRAPDOOR_OPEN.- Returns:
- this builder for chaining
-
pressurePlateClickOffSound
public BlockSetTypeBuilder pressurePlateClickOffSound(net.minecraft.sounds.SoundEvent pressurePlateClickOffSound) Sets this block set type's pressure plate click off sound.Defaults to
SoundEvents.WOODEN_PRESSURE_PLATE_CLICK_OFF.- Returns:
- this builder for chaining
-
pressurePlateClickOnSound
public BlockSetTypeBuilder pressurePlateClickOnSound(net.minecraft.sounds.SoundEvent pressurePlateClickOnSound) Sets this block set type's pressure plate click on sound.Defaults to
SoundEvents.WOODEN_PRESSURE_PLATE_CLICK_ON.- Returns:
- this builder for chaining
-
buttonClickOffSound
Sets this block set type's button click off sound.Defaults to
SoundEvents.WOODEN_BUTTON_CLICK_OFF.- Returns:
- this builder for chaining
-
buttonClickOnSound
Sets this block set type's button click on sound.Defaults to
SoundEvents.WOODEN_BUTTON_CLICK_ON.- Returns:
- this builder for chaining
-
copyOf
Creates a newBlockSetTypeBuilderthat copies all of another builder's values.- Parameters:
builder- theBlockSetTypeBuilderwhose values are to be copied- Returns:
- the created copy
-
copyOf
public static BlockSetTypeBuilder copyOf(net.minecraft.world.level.block.state.properties.BlockSetType setType) Creates a newBlockSetTypeBuilderthat copies all of another block set type's values.- Parameters:
setType- theBlockSetTypewhose values are to be copied- Returns:
- the created copy
-
register
public net.minecraft.world.level.block.state.properties.BlockSetType register(net.minecraft.resources.Identifier id) Builds and registers aBlockSetTypefrom this builder's values.Alternatively, you can use
build(Identifier)to build without registering.
ThenBlockSetType.register(BlockSetType)can be used to register it later.- Parameters:
id- the id for the builtBlockSetType- Returns:
- the built and registered
BlockSetType
-
build
public net.minecraft.world.level.block.state.properties.BlockSetType build(net.minecraft.resources.Identifier id) Builds aBlockSetTypefrom this builder's values without registering it.Use
BlockSetType.register(BlockSetType)to register it later.
Alternatively, you can useregister(Identifier)to build and register it now.- Parameters:
id- the id for the builtBlockSetType- Returns:
- the built
BlockSetType
-