BlockEntity
Link to blockentity
Importing the class
Link to 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.
ZenScript Copyimport crafttweaker.api.block.entity.BlockEntity;
Extending AttachmentHolder
Link to extending-attachmentholder
BlockEntity extends AttachmentHolder. That means all methods available in AttachmentHolder are also available in BlockEntity
Methods
Link to methods
Name: getBlockPos
Return Type: BlockPos
ZenScript Copy// BlockEntity.getBlockPos() as BlockPos
myBlockEntity.getBlockPos();
Name: getBlockState
Return Type: BlockState
ZenScript Copy// BlockEntity.getBlockState() as BlockState
myBlockEntity.getBlockState();
Name: getLevel
Return Type: Level?
ZenScript Copy// BlockEntity.getLevel() as Level?
myBlockEntity.getLevel();
Name: getRegistryName
Return Type: ResourceLocation
ZenScript Copy// BlockEntity.getRegistryName() as ResourceLocation
myBlockEntity.getRegistryName();
Name: hasLevel
Return Type: boolean
ZenScript Copy// BlockEntity.hasLevel() as boolean
myBlockEntity.hasLevel();
Name: updateData
ZenScript CopyBlockEntity.updateData(data as IData)
Parameter | Type |
---|---|
Parameter data | Type IData |
Properties
Link to properties
Name | Type | Has Getter | Has Setter |
---|---|---|---|
Name blockPos | Type BlockPos | Has Getter true | Has Setter false |
Name blockState | Type BlockState | Has Getter true | Has Setter false |
Name data | Type IData | Has Getter true | Has Setter true |
Name hasLevel | Type boolean | Has Getter true | Has Setter false |
Name level | Type Level? | Has Getter true | Has Setter false |
Name registryName | Type ResourceLocation | Has Getter true | Has Setter false |