Class FabricBlockEntityTypeBuilder<T extends net.minecraft.world.level.block.entity.BlockEntity>
java.lang.Object
net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder<T>
public final class FabricBlockEntityTypeBuilder<T extends net.minecraft.world.level.block.entity.BlockEntity>
extends Object
Use this builder to create a
BlockEntityType.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceFabricBlockEntityTypeBuilder.Factory<T extends net.minecraft.world.level.block.entity.BlockEntity> -
Method Summary
Modifier and TypeMethodDescriptionaddBlock(net.minecraft.world.level.block.Block block) Adds a supported block for the block entity type.addBlocks(Collection<? extends net.minecraft.world.level.block.Block> blocks) Adds supported blocks for the block entity type.addBlocks(net.minecraft.world.level.block.Block... blocks) Adds supported blocks for the block entity type.net.minecraft.world.level.block.entity.BlockEntityType<T> build()net.minecraft.world.level.block.entity.BlockEntityType<T> build(@Nullable com.mojang.datafixers.types.Type<?> type) Deprecated.canPotentiallyExecuteCommands(boolean canPotentiallyExecuteCommands) Makes the builtBlockEntityTypereturntruefromBlockEntityType.onlyOpCanSetNbt().static <T extends net.minecraft.world.level.block.entity.BlockEntity>
FabricBlockEntityTypeBuilder<T> create(FabricBlockEntityTypeBuilder.Factory<? extends T> factory, net.minecraft.world.level.block.Block... blocks)
-
Method Details
-
create
public static <T extends net.minecraft.world.level.block.entity.BlockEntity> FabricBlockEntityTypeBuilder<T> create(FabricBlockEntityTypeBuilder.Factory<? extends T> factory, net.minecraft.world.level.block.Block... blocks) -
addBlock
Adds a supported block for the block entity type.- Parameters:
block- the supported block- Returns:
- this builder
-
addBlocks
Adds supported blocks for the block entity type.- Parameters:
blocks- the supported blocks- Returns:
- this builder
-
addBlocks
public FabricBlockEntityTypeBuilder<T> addBlocks(Collection<? extends net.minecraft.world.level.block.Block> blocks) Adds supported blocks for the block entity type.- Parameters:
blocks- the supported blocks- Returns:
- this builder
-
canPotentiallyExecuteCommands
public FabricBlockEntityTypeBuilder<T> canPotentiallyExecuteCommands(boolean canPotentiallyExecuteCommands) Makes the builtBlockEntityTypereturntruefromBlockEntityType.onlyOpCanSetNbt().- Parameters:
canPotentiallyExecuteCommands- whether the block entity is able to execute commands- Returns:
- this builder
-
build
-
build
@Deprecated public net.minecraft.world.level.block.entity.BlockEntityType<T> build(@Nullable com.mojang.datafixers.types.Type<?> type) Deprecated.Usebuild()instead.
-
build()instead.