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.
  • 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

      public FabricBlockEntityTypeBuilder<T> addBlock(net.minecraft.world.level.block.Block block)
      Adds a supported block for the block entity type.
      Parameters:
      block - the supported block
      Returns:
      this builder
    • addBlocks

      public FabricBlockEntityTypeBuilder<T> addBlocks(net.minecraft.world.level.block.Block... blocks)
      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 built BlockEntityType return true from BlockEntityType.onlyOpCanSetNbt().
      Parameters:
      canPotentiallyExecuteCommands - whether the block entity is able to execute commands
      Returns:
      this builder
    • build

      public net.minecraft.world.level.block.entity.BlockEntityType<T> build()
    • build

      @Deprecated public net.minecraft.world.level.block.entity.BlockEntityType<T> build(@Nullable com.mojang.datafixers.types.Type<?> type)
      Deprecated.
      Use build() instead.