BlockState
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.BlockState;
Description
Extends
BlockState extends BlockStateBase
.
Implements
Undocumented Interfaces
IBlockStateExtension
Operators
myBlockState | myCTBlockIngredient
Parameters:
other: BlockIngredient
Type: BlockIngredient
Return Type:
BlockIngredient
myBlockState == myBlockState
Parameters:
other: BlockState
Type: BlockState
Return Type:
bool
Members
// BlockState as BlockIngredientmyBlockState as CTBlockIngredient
Return Type:
BlockIngredient
// BlockState.asString() as string;myBlockState.asString();
Return Type:
string
// BlockState.canOcclude as boolmyBlockState.canOcclude
Return Type:
bool
Returns: True if this BlockState is solid. False otherwise.
// BlockState.canOcclude() as bool;myBlockState.canOcclude();
Return Type:
bool
E.G.
<blockstate:minecraft:grass:snowy=true>
// BlockState.commandString as stringmyBlockState.commandString
Return Type:
string
E.G.
<blockstate:minecraft:grass:snowy=true>
Returns: The blockstate bracket handler syntax for this BlockState.
// BlockState.commandString() as string;myBlockState.commandString();
Return Type:
string
E.G.
<blockstate:minecraft:grass:snowy=true>
// BlockState as stringmyBlockState as string
Return Type:
string
// BlockState.destroySpeed as floatmyBlockState.destroySpeed
Return Type:
float
// BlockState.destroySpeed = (destroySpeed as float);myBlockState.destroySpeed = myFloat;
Parameters:
destroySpeed: float
Type: float
- the new destroy speed of this BlockState Returns: The hardness of this BlockState.
// BlockState.destroySpeed() as float;myBlockState.destroySpeed();
Return Type:
float
// BlockState.destroySpeed(destroySpeed as float);myBlockState.destroySpeed(2.4f);
Parameters:
destroySpeed: float
Type: float
- the new destroy speed of this BlockState Returns: a List of allowed values.
// BlockState.getAllowedValuesForProperty(name as string) as List<string>;myBlockState.getAllowedValuesForProperty("snowy");
Parameters:
name: string
Type: string
- The name of the property to find the allowed values for.
Return Type:
List<string>
Returns: The value of the property on this BlockState.
// BlockState.getPropertyValue(name as string) as string;myBlockState.getPropertyValue(myString);
Parameters:
name: string
Type: string
- "snowy"
Return Type:
string
net.minecraft.world.level.block.entity.BlockEntity
.// BlockState.hasBlockEntity as boolmyBlockState.hasBlockEntity
Return Type:
bool
net.minecraft.world.level.block.entity.BlockEntity
.Returns: True if this BlockState has a net.minecraft.world.level.block.entity.BlockEntity
. False otherwise.
// BlockState.hasBlockEntity() as bool;myBlockState.hasBlockEntity();
Return Type:
bool
Returns: True if this BlockState has the property. False otherwise.
// BlockState.hasProperty(name as string) as bool;myBlockState.hasProperty("snowy");
Parameters:
name: string
Type: string
- the name of the property to check.
Return Type:
bool
// BlockState.isRandomlyTicking as boolmyBlockState.isRandomlyTicking
Return Type:
bool
Returns: True if this BlockState ticks randomly. False otherwise.
// BlockState.isRandomlyTicking() as bool;myBlockState.isRandomlyTicking();
Return Type:
bool
// BlockState.isSignalSource as boolmyBlockState.isSignalSource
Return Type:
bool
Returns: True if this BlockState can provide Redstone Power. False otherwise.
// BlockState.isSignalSource() as bool;myBlockState.isSignalSource();
Return Type:
bool
// BlockState.lightEmission as intmyBlockState.lightEmission
Return Type:
int
Returns: The light level of this BlockState.
// BlockState.lightEmission() as int;myBlockState.lightEmission();
Return Type:
int
myBlockState.matches(myBlockState);
Parameters:
other: BlockState
Type: BlockState
Return Type:
bool
// BlockState.properties as string[string]myBlockState.properties
Return Type:
string[string]
Returns: a Map of the properties on this BlockState.
// BlockState.properties() as string[string];myBlockState.properties();
Return Type:
string[string]
// BlockState.propertyNames as List<string>myBlockState.propertyNames
Return Type:
List<string>
Returns: the List of the names of the BlockStates's properties.
// BlockState.propertyNames() as List<string>;myBlockState.propertyNames();
Return Type:
List<string>
myBlockState.rotate(myRotation);
Return Type:
BlockState
Returns: This BlockState with the new property value.
myBlockState.withProperty("snowy", "true");
Parameters:
name: string
Type: string
- The name of the property to set. value: string
Type: string
- The new value of the property.
Return Type:
BlockState