BlockEntity
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.entity.BlockEntity;
Extends
BlockEntity extends CapabilityProvider<BlockEntity>
.
Implements
BlockEntity
implements the following interfaces:
ICapabilityProviderImpl<ICapabilityProviderImpl>
,ICapabilityProvider
Undocumented Interfaces
IBlockEntityExtension
,ICapabilitySerializable<CompoundTag>
,INBTSerializable<Tag>
Members
Getter
// BlockEntity.blockState as BlockStatemyBlockEntity.blockState
Return Type:
BlockState
blockState() as BlockState
Getter
Setter
data(data as IData)
getCapability(cap as Capability<T>, side as Direction) as T?
Gets the capability for the given side.script.zs
Returns: The found capability or null.
myBlockEntity.getCapability<T>(Capabilities.ENERGY, <constant:minecraft:direction:north>);
Parameters:
Return Type:
T?
getCapability(cap as Capability<T>) as T?
Gets the capability.script.zs
Returns: The found capability or null.
myBlockEntity.getCapability<T>(Capabilities.ENERGY);
Parameters:
Return Type:
T?
Getter
// BlockEntity.hasLevel as boolmyBlockEntity.hasLevel
Return Type:
bool
hasLevel() as bool
// BlockEntity.hasLevel() as bool;myBlockEntity.hasLevel();
Return Type:
bool
Getter
// BlockEntity.registryName as ResourceLocationmyBlockEntity.registryName
Return Type:
ResourceLocation
registryName() as ResourceLocation