Block
Importing the class
If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.
import crafttweaker.api.block.Block;
Description
Extends
Block extends BlockBehaviour
.
Implements
Block
implements the following interfaces:
Undocumented Interfaces
IBlockExtension
,FeatureElement
Operators
myBlock | myCTBlockIngredient
Parameters:
other: BlockIngredient
Type: BlockIngredient
Return Type:
BlockIngredient
Members
// Block as BlockIngredientmyBlock as CTBlockIngredient
Return Type:
BlockIngredient
***NOTE:*** Not all Blocks have Items, for instance, a Lit Redstone Lamp does not have an Item.
Returns: The Item representation of this Block.
myBlock.asItem();
Return Type:
ItemDefinition
***NOTE:*** Not all Blocks have Items, for instance, a Lit Redstone Lamp does not have an Item.
// Block as ItemDefinitionmyBlock as Item
Return Type:
ItemDefinition
E.G.
<block:minecraft:dirt>
// Block.commandString as stringmyBlock.commandString
Return Type:
string
E.G.
<block:minecraft:dirt>
Returns: The block bracket handler syntax for this Block.
// Block.commandString() as string;myBlock.commandString();
Return Type:
string
E.G.
<block:minecraft:dirt>
// Block as stringmyBlock as string
Return Type:
string
BlockState
of this Block.// Block.defaultState as BlockStatemyBlock.defaultState
Return Type:
BlockState
BlockState
of this Block.Returns: The default BlockState
of this Block.
myBlock.defaultState();
Return Type:
BlockState
// Block.descriptionId as stringmyBlock.descriptionId
Return Type:
string
Returns: The unlocalized name of this block.
// Block.descriptionId() as string;myBlock.descriptionId();
Return Type:
string
// Block.dynamicShape as boolmyBlock.dynamicShape
Return Type:
bool
Returns: True if this Block has variable opacity. False otherwise.
// Block.dynamicShape() as bool;myBlock.dynamicShape();
Return Type:
bool
// Block.explosionResistance as floatmyBlock.explosionResistance
Return Type:
float
// Block.explosionResistance = (resistance as float);myBlock.explosionResistance = myFloat;
Parameters:
resistance: float
Type: float
- The new blast resistance of this Block. Returns: The blast resistance of this Block.
// Block.explosionResistance() as float;myBlock.explosionResistance();
Return Type:
float
// Block.explosionResistance(resistance as float);myBlock.explosionResistance(2);
Parameters:
resistance: float
Type: float
- The new blast resistance of this Block. // Block.friction as floatmyBlock.friction
Return Type:
float
// Block.friction = (friction as float);myBlock.friction = myFloat;
Parameters:
friction: float
Type: float
- The new friction of this Block. Returns: The friction of this Block.
// Block.friction() as float;myBlock.friction();
Return Type:
float
// Block.friction(friction as float);myBlock.friction(2);
Parameters:
friction: float
Type: float
- The new friction of this Block. // Block.hasCollision as boolmyBlock.hasCollision
Return Type:
bool
// Block.hasCollision = (canCollide as bool);myBlock.hasCollision = myBool;
Parameters:
canCollide: bool
Type: bool
- Can entities collide with this Block. Returns: True if entities will collide with this Block. False otherwise.
// Block.hasCollision() as bool;myBlock.hasCollision();
Return Type:
bool
// Block.hasCollision(canCollide as bool);myBlock.hasCollision(true);
Parameters:
canCollide: bool
Type: bool
- Can entities collide with this Block. This is used to find valid spawn locations for players.
Returns: True if an entity can be spawned in this Block. False Otherwise.
myBlock.isPossibleToRespawnInThis(myBlockState);
Parameters:
state: BlockState
Type: BlockState
Return Type:
bool
// Block.jumpFactor as floatmyBlock.jumpFactor
Return Type:
float
// Block.jumpFactor = (jumpFactor as float);myBlock.jumpFactor = myFloat;
Parameters:
jumpFactor: float
Type: float
- The new jump factor of this Block. Returns: The jump factor of this Block.
// Block.jumpFactor() as float;myBlock.jumpFactor();
Return Type:
float
// Block.jumpFactor(jumpFactor as float);myBlock.jumpFactor(2);
Parameters:
jumpFactor: float
Type: float
- The new jump factor of this Block. // Block.lootTable as stringmyBlock.lootTable
Return Type:
string
Returns: The loot table id for this Block.
// Block.lootTable() as string;myBlock.lootTable();
Return Type:
string
// Block.name as MutableComponentmyBlock.name
Return Type:
MutableComponent
Returns: The name of this block.
myBlock.name();
Return Type:
MutableComponent
BlockState
s for this Block.myBlock.possibleStates
Return Type:
List<BlockState>
BlockState
s for this Block.Returns: A list of valid BlockState
s for this Block.
myBlock.possibleStates();
Return Type:
List<BlockState>
// Block.registryName as ResourceLocationmyBlock.registryName
Return Type:
ResourceLocation
Returns: A ResourceLocation of the registry name of this block.
myBlock.registryName();
Return Type:
ResourceLocation
// Block.speedFactor as floatmyBlock.speedFactor
Return Type:
float
// Block.speedFactor = (speedFactor as float);myBlock.speedFactor = myFloat;
Parameters:
speedFactor: float
Type: float
- The new speed factor of this Block. Returns: The speed factor of this Block.
// Block.speedFactor() as float;myBlock.speedFactor();
Return Type:
float
// Block.speedFactor(speedFactor as float);myBlock.speedFactor(2);
Parameters:
speedFactor: float
Type: float
- The new speed factor of this Block.