Home Commands Examples Getting Started With Scripts Global Keywords 1.21 Migration Guide
BracketDumpers BracketHandlers BracketValidators ResourceLocationBracketHandler

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.

script.zs
import crafttweaker.api.block.entity.BlockEntity;

Extends

BlockEntity extends AttachmentHolder.

Implements

BlockEntity implements the following interfaces:

IAttachmentHolder

Undocumented Interfaces

IBlockEntityExtension

Members

Getter
script.zs
// BlockEntity.blockPos as BlockPos
myBlockEntity.blockPos

Return Type: BlockPos

blockPos() as BlockPos
script.zs
// BlockEntity.blockPos() as BlockPos;
myBlockEntity.blockPos();

Return Type: BlockPos

Getter
script.zs
// BlockEntity.blockState as BlockState
myBlockEntity.blockState

Return Type: BlockState

blockState() as BlockState
script.zs
// BlockEntity.blockState() as BlockState;
myBlockEntity.blockState();

Return Type: BlockState

Getter
script.zs
// BlockEntity.data as IData
myBlockEntity.data

Return Type: IData

Setter
script.zs
// BlockEntity.data = (data as IData);
myBlockEntity.data = myIData;

Parameters:

data Type: IData
data(data as IData)
script.zs
// BlockEntity.data(data as IData);
myBlockEntity.data(myIData);

Parameters:

data Type: IData
getAttachmentData(type as AttachmentType<T>) as T
script.zs
// BlockEntity.getAttachmentData<T>(type as AttachmentType<T>) as T;
myBlockEntity.getAttachmentData<T>(myAttachmentType);

Parameters:

type Type: AttachmentType<T>

Return Type: T

getAttachmentData(type as Supplier<AttachmentType<T>>) as T
script.zs
// BlockEntity.getAttachmentData<T>(type as Supplier<AttachmentType<T>>) as T;
myBlockEntity.getAttachmentData<T>(mySupplier);

Parameters:

type Type: Supplier<AttachmentType<T>>

Return Type: T

hasAttachmentData(type as AttachmentType<T>) as bool
script.zs
// BlockEntity.hasAttachmentData<T>(type as AttachmentType<T>) as bool;
myBlockEntity.hasAttachmentData<T>(myAttachmentType);

Parameters:

type Type: AttachmentType<T>

Return Type: bool

hasAttachmentData(type as Supplier<AttachmentType<T>>) as bool
script.zs
// BlockEntity.hasAttachmentData<T>(type as Supplier<AttachmentType<T>>) as bool;
myBlockEntity.hasAttachmentData<T>(mySupplier);

Parameters:

type Type: Supplier<AttachmentType<T>>

Return Type: bool

Getter
script.zs
// BlockEntity.hasLevel as bool
myBlockEntity.hasLevel

Return Type: bool

hasLevel() as bool
script.zs
// BlockEntity.hasLevel() as bool;
myBlockEntity.hasLevel();

Return Type: bool

Getter
script.zs
// BlockEntity.level as Level
myBlockEntity.level

Return Type: Level

level() as Level
script.zs
// BlockEntity.level() as Level;
myBlockEntity.level();

Return Type: Level

Getter
script.zs
// BlockEntity.registryName as ResourceLocation
myBlockEntity.registryName

Return Type: ResourceLocation

registryName() as ResourceLocation
script.zs
// BlockEntity.registryName() as ResourceLocation;
myBlockEntity.registryName();

Return Type: ResourceLocation

setAttachmentData(type as AttachmentType<T>, data as T) as T?
script.zs
// BlockEntity.setAttachmentData<T>(type as AttachmentType<T>, data as T) as T?;
myBlockEntity.setAttachmentData<T>(myAttachmentType, myT);

Parameters:

type Type: AttachmentType<T>
data Type: T

Return Type: T?

setAttachmentData(type as Supplier<AttachmentType<T>>, data as T) as T?
script.zs
// BlockEntity.setAttachmentData<T>(type as Supplier<AttachmentType<T>>, data as T) as T?;
myBlockEntity.setAttachmentData<T>(mySupplier, myT);

Parameters:

type Type: Supplier<AttachmentType<T>>
data Type: T

Return Type: T?

updateData(data as IData)
script.zs
// BlockEntity.updateData(data as IData);
myBlockEntity.updateData(myIData);

Parameters:

data Type: IData