The blockbuilder is used to... build blocks (you totally didn't see that one coming, right... right?).
Once you created it you can set various properties which will be outlined by the separate methods.

You can also change the block's type to create a more specialized form of block (e.g. stairs or Blocks that can be rotated in the same way logs can). To tell CoT that you want the block to appear ingame you need to call mods.contenttweaker.block.BlockBuilder#build(String) and specify a valid resource location path.

This class was added by a mod with mod-id contenttweaker. So you need to have this mod installed if you want to use this feature.

Importing the class

Link to importing-the-class

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import.

ZenScript
Copy
mods.contenttweaker.block.BlockBuilder

Implemented Interfaces

Link to implemented-interfaces

BlockBuilder implements the following interfaces. That means any method available to them can also be used on this class.

Creates a new BlockBuilder. Remember that this will not create a new block in the game, you need to call mods.contenttweaker.block.BlockBuilder#build(String) for that.

ZenScript
Copy
new mods.contenttweaker.block.BlockBuilder(material as crafttweaker.api.block.material.MCMaterial);
new mods.contenttweaker.block.BlockBuilder();
new mods.contenttweaker.block.BlockBuilder(<blockmaterial:earth>);
ParameterTypeDescriptionIsOptionalDefault Value
Parameter
material
Type
crafttweaker.api.block.material.MCMaterial
Description
The material this block will have
IsOptional
true
Default Value
<blockmaterial:iron>

CoT에게 이 제작기가 빌드해야 하는 모든 블록을 실제로 빌드하도록 지시합니다.

ZenScript
Copy
myBlockBuilder.build(resourceLocation as String);
myBlockBuilder.build("my_awesome_block");
ParameterTypeDescription
Parameter
resourceLocation
Type
String
Description
해당 블록의 리소스 경로

withHardnessAndResistance

Link to withhardnessandresistance

Sets the block's hardness and resistance levels. Unlike the other method, this one only accepts one parameter and will use that value for both properties.

Returns: This builder, used for method chaining

Return type: mods.contenttweaker.block.BlockBuilder

ZenScript
Copy
myBlockBuilder.withHardnessAndResistance(hardnessAndResistance as float);
myBlockBuilder.withHardnessAndResistance(0.5f);
ParameterTypeDescription
Parameter
hardnessAndResistance
Type
float
Description
The value to set for hardness and for resistance.

Sets the block's hardness and resistance levels. Unlike the other method, this one allows you to set each property one to a separate value.

Returns: This builder, used for method chaining

Return type: mods.contenttweaker.block.BlockBuilder

ZenScript
Copy
myBlockBuilder.withHardnessAndResistance(hardnessIn as float, resistanceIn as float);
myBlockBuilder.withHardnessAndResistance(0.5f, 0.5f);
ParameterTypeDescription
Parameter
hardnessIn
Type
float
Description
The value to set for hardness
Parameter
resistanceIn
Type
float
Description
The value to set for resistance.

withHarvestLevel

Link to withharvestlevel

Sets the mining level required to mine this block

Returns: This builder, used for method chaining

Return type: mods.contenttweaker.block.BlockBuilder

ZenScript
Copy
myBlockBuilder.withHarvestLevel(harvestLevel as int);
myBlockBuilder.withHarvestLevel(3);
ParameterTypeDescription
Parameter
harvestLevel
Type
int
Description
The harvest level requried

Sets the tool required to harvest this block

Returns: This builder, used for method chaining

Return type: mods.contenttweaker.block.BlockBuilder

ZenScript
Copy
myBlockBuilder.withHarvestTool(harvestTool as mods.contenttweaker.item.MCToolType);
myBlockBuilder.withHarvestTool(<tooltype:shovel>);
ParameterTypeDescription
Parameter
harvestTool
Type
mods.contenttweaker.item.MCToolType
Description
The tool type

Sets the item group in which this block will appear

Returns: This builder, used for method chaining

Return type: mods.contenttweaker.block.BlockBuilder

ZenScript
Copy
myBlockBuilder.withItemGroup(group as mods.contenttweaker.item.MCItemGroup);
myBlockBuilder.withItemGroup(<itemgroup:building_blocks>);
ParameterTypeDescription
Parameter
group
Type
mods.contenttweaker.item.MCItemGroup
Description
The group to set

Sets the block's light value.

Returns: This builder, used for method chaining

Return type: mods.contenttweaker.block.BlockBuilder

ZenScript
Copy
myBlockBuilder.withLightValue(lightValueIn as int);
myBlockBuilder.withLightValue(15);
ParameterTypeDescription
Parameter
lightValueIn
Type
int
Description
The light level to set

Will instruct CoT to override this block's loot table with the one of the block Provided. Currently this will still create a loot table entry, though it will be ignored by the game.

Returns: This builder, used for method chaining

Return type: mods.contenttweaker.block.BlockBuilder

ZenScript
Copy
myBlockBuilder.withLootFrom(blockIn as crafttweaker.api.block.MCBlock);
myBlockBuilder.withLootFrom(<block:minecraft:diamond>);
ParameterTypeDescription
Parameter
blockIn
Type
crafttweaker.api.block.MCBlock
Description
The block whose loot table should be applied

withMaxStackSize

Link to withmaxstacksize

Sets the maximum Stack size that this block can have when in your inventory. Will be 64 if unchanged.

Returns: This builder, used for chaining

Return type: mods.contenttweaker.block.BlockBuilder

ZenScript
Copy
myBlockBuilder.withMaxStackSize(size as int);
myBlockBuilder.withMaxStackSize(16);
ParameterTypeDescription
Parameter
size
Type
int
Description
The size to set.

Allows you to set the rarity of this block.

Returns: This builder, used for method chaining

Return type: mods.contenttweaker.block.BlockBuilder

ZenScript
Copy
myBlockBuilder.withRarity(rarity as String);
myBlockBuilder.withRarity("UNCOMMON");
ParameterTypeDescription
Parameter
rarity
Type
String
Description
The rarity

withSlipperiness

Link to withslipperiness

Sets the slipperiness.

Returns: This builder, used for method chaining

Return type: mods.contenttweaker.block.BlockBuilder

ZenScript
Copy
myBlockBuilder.withSlipperiness(slipperinessIn as float);
myBlockBuilder.withSlipperiness(0.5f);
ParameterTypeDescription
Parameter
slipperinessIn
Type
float
Description
The value to set

Sets the specific type of this block. After this method is called the builder's context will switch to the more provided type builder. That means that the methods of this builder will no longer be available, so any properties you wish to set should be set before you call this method.

Returns: A builder with the given block.

Return type: T

ZenScript
Copy
myBlockBuilder.withType<T>();
myBlockBuilder.withType<mods.contenttweaker.block.pillar.BlockBuilderPillarRotatable>();
ParameterNameBounds
ParameterName
T
Bounds
mods.contenttweaker.block.BlockTypeBuilder

Will instruct CoT that this block will not have any loot entries. Currently this will still create a loot table entry, though it will be ignored by the game.

Returns: This builder, used for method chaining

Return type: mods.contenttweaker.block.BlockBuilder

ZenScript
Copy
myBlockBuilder.withoutDrops();

withoutMovementBlocking

Link to withoutmovementblocking

Instructs CoT that this block will does not block movement.

Returns: This builder, used for chaining

Return type: mods.contenttweaker.block.BlockBuilder

ZenScript
Copy
myBlockBuilder.withoutMovementBlocking();