Home Migration Guide Getting Started With Scripts Commands Examples
BracketHandlers

IEnergyStorage

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.

script.zs
import crafttweaker.api.capability.IEnergyStorage;

Methods

Return Type: boolean

script.zs
// IEnergyStorage.canExtract() as boolean
myIEnergyStorage.canExtract();

Return Type: boolean

script.zs
// IEnergyStorage.canReceive() as boolean
myIEnergyStorage.canReceive();

Return Type: int

script.zs
IEnergyStorage.extractEnergy(maxExtract as int, simulate as boolean) as int
ParameterTypeDescription
Parameter
maxExtract
Type
int
Description
No Description Provided
Parameter
simulate
Type
boolean
Description
No Description Provided

Return Type: int

script.zs
// IEnergyStorage.getEnergyStored() as int
myIEnergyStorage.getEnergyStored();

Return Type: int

script.zs
// IEnergyStorage.getMaxEnergyStored() as int
myIEnergyStorage.getMaxEnergyStored();

Return Type: int

script.zs
IEnergyStorage.receiveEnergy(maxReceive as int, simulate as boolean) as int
ParameterTypeDescription
Parameter
maxReceive
Type
int
Description
No Description Provided
Parameter
simulate
Type
boolean
Description
No Description Provided

Properties

NameTypeHas GetterHas SetterDescription
Name
canExtract
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
canReceive
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
energyStored
Type
int
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
maxEnergyStored
Type
int
Has Getter
true
Has Setter
false
Description
No Description Provided