Home Migration Guide Getting Started With Scripts Commands Examples
BracketHandlers

MCMaterial

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 at the very top of the file.

script.zs
import crafttweaker.api.block.material.MCMaterial;

Methods

Returns if this material is considered solid or not

Return Type: boolean

script.zs
// MCMaterial.blocksMovement() as boolean
myMCMaterial.blocksMovement();

Retrieves the color index of the block. This is is the same color used by vanilla maps to represent this block.

Return Type: MCMaterialColor

script.zs
// MCMaterial.getColor() as MCMaterialColor
myMCMaterial.getColor();

Gets the bracket syntax for this Material

Returns: The <blockmaterial> Bracket Syntax for this material
Return Type: string

script.zs
// MCMaterial.getCommandString() as string
myMCMaterial.getCommandString();

Gets this Material’s PushReaction.

Returns: The PushReaction of this Material.
Return Type: PushReaction

script.zs
// MCMaterial.getPushReaction() as PushReaction
myMCMaterial.getPushReaction();

Returns if the block can burn or not.

Return Type: boolean

script.zs
// MCMaterial.isFlammable() as boolean
myMCMaterial.isFlammable();

Returns if blocks of these materials are liquids.

Return Type: boolean

script.zs
// MCMaterial.isLiquid() as boolean
myMCMaterial.isLiquid();

Indicate if the material is opaque

Return Type: boolean

script.zs
// MCMaterial.isOpaque() as boolean
myMCMaterial.isOpaque();

Returns whether the material can be replaced by other blocks when placed - eg snow, vines and tall grass.

Return Type: boolean

script.zs
// MCMaterial.isReplaceable() as boolean
myMCMaterial.isReplaceable();

Returns true if the block is a considered solid. This is true by default.

Return Type: boolean

script.zs
// MCMaterial.isSolid() as boolean
myMCMaterial.isSolid();

Properties

NameTypeHas GetterHas SetterDescription
Name
blocksMovement
Type
boolean
Has Getter
true
Has Setter
false
Description
Returns if this material is considered solid or not
Name
color
Type
MCMaterialColor
Has Getter
true
Has Setter
false
Description
Retrieves the color index of the block. This is is the same color used by vanilla maps to represent this block.
Name
commandString
Type
string
Has Getter
true
Has Setter
false
Description
Gets the bracket syntax for this Material
Name
flammable
Type
boolean
Has Getter
true
Has Setter
false
Description
Returns if the block can burn or not.
Name
liquid
Type
boolean
Has Getter
true
Has Setter
false
Description
Returns if blocks of these materials are liquids.
Name
opaque
Type
boolean
Has Getter
true
Has Setter
false
Description
Indicate if the material is opaque
Name
pushReaction
Type
PushReaction
Has Getter
true
Has Setter
false
Description
Gets this Material’s PushReaction.
Name
replaceable
Type
boolean
Has Getter
true
Has Setter
false
Description
Returns whether the material can be replaced by other blocks when placed - eg snow, vines and tall grass.
Name
solid
Type
boolean
Has Getter
true
Has Setter
false
Description
Returns true if the block is a considered solid. This is true by default.