BlockEntity
Link to blockentity
Importare la Classe
Link to importare-la-classe
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 CapabilityProvider<BlockEntity>
Link to extending-capabilityproviderblockentity
BlockEntity extends CapabilityProvider<BlockEntity>. That means all methods available in CapabilityProvider<BlockEntity> are also available in BlockEntity
Metodi
Link to metodi
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)
Parametro | Tipo |
---|---|
Parametro data | Tipo IData |
Proprietà
Link to proprietà
Nome | Tipo | Ha Getter | Ha Setter |
---|---|---|---|
Nome blockPos | Tipo BlockPos | Ha Getter sì | Ha Setter no |
Nome blockState | Tipo BlockState | Ha Getter sì | Ha Setter no |
Nome data | Tipo IData | Ha Getter sì | Ha Setter sì |
Nome hasLevel | Tipo boolean | Ha Getter sì | Ha Setter no |
Nome level | Tipo Level? | Ha Getter sì | Ha Setter no |
Nome registryName | Tipo ResourceLocation | Ha Getter sì | Ha Setter no |