Home Getting Started With Scripts Using this wiki Commands CTGUI Global functions Bracket Handlers

IBlockProperties

BlockProperties are what makes a block distinctive from other blocks. It mainly serves as superinterface to IBlockState, that means all these functions are also available to all IBlockState objects.

Importing the package

It might be required for you to import the package if you encounter any issues, so better be safe than sorry and add the import.
import crafttweaker.block.IBlockProperties;

ZenGetterReturn TypeDescription
ZenGetter
canProvidePower
Return Type
bool
Description
Returns if the refered block can provide Redstone Power
ZenGetter
mobilityFlag
Return Type
string
Description
Returns the mobility flag as string
ZenGetter
material
Return Type
IMaterial
Description
Returns the block’s material
ZenGetter
causesSuffocation
Return Type
bool
Description
Returns whether the block can choke you.
ZenGetter
hasCustomBreakingProgress
Return Type
bool
Description
ZenGetter
blockNormalCube
Return Type
bool
Description
ZenGetter
fullBlock
Return Type
bool
Description
ZenGetter
fullCube
Return Type
bool
Description
ZenGetter
normalCube
Return Type
bool
Description
ZenGetter
opaqueCube
Return Type
bool
Description
ZenGetter
translucent
Return Type
bool
Description
ZenGetter
useNeighborBrightness
Return Type
bool
Description

ZenMethods

isReplacable

boolean isReplaceable(IWorld world, IBlockPos pos);
Parameters:

  • IWorld world → The world to be checked in
  • IBlockPos pos → The Block’s position

Returns a boolean that sais whether the block can be replaced or not.

getLightValue

int getLightValue(IWorld world, IBlockPos blockPos);
Parameters:

Returns an int representing the current light value at the given location.

getWeakPower/GetStrongPower

int getWeakPower(IBlockAccess world, IBlockPos blockPos, Facing facing);
int getStrongPower(IBlockAccess world, IBlockPos blockPos, Facing facing);
Parameters:

  • IBlockAccess world → The world to be checked in
  • IBlockPos pos → The Block’s position
  • Facing facing → The side to be checked Returns an int representing the current redstone power on this side.

getComparatorInputOverride

int getComparatorInputOverride(IWorld world, IBlockPos blockPos);

Parameters:

  • IWorld world → The world to be checked in
  • IBlockPos pos → The Block’s position

Returns an int representing the block’s redstone comparator input override type.

Check if an entity can spawn on the block

Use an IEntity.
Returns a bool.

script.zs
blockProperties.canEntitySpawn(IEntity entity);

Get the actual BlockState

Use an IBlockAccess and an IBlockPos.
Returns a new IBlockProperties object.

script.zs
blockProperties.getActualState(IBlockAccess world, IBlockPos pos);

Get a block’s hardness

Use IWorld and an IBlockPos.
Returns a float.

script.zs
blockProperties.getBlockHardness(IWorld world, IBlockPos pos);

Get a block’s light opacy

Use IWorld and an IBlockPos.
Returns an int.

script.zs
blockProperties.getLightOpacy(IWorld world, IBlockPos pos);

Get a player’s Relative Block Harness

Use an IPlayer, an IWorld and an IBlockPos.
Returns a float.

script.zs
blockProperties.getPlayerRelativeBlockHardness(IPlayer player, IWorld world, IBlockPos pos);

Check if a side of the block is solid

Use an IBlockAccess, an IBlockPos and an IFacing object.
Returns a bool.

script.zs
blockProperties.isSideSolid(IBlockAccess world, IBlockPos pos, IFacing facing);