ListData
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.data.ListData;
Description
Implements
ListData
implements the following interfaces:
Constructors
// new ListData();new ListData();
Operators
Members
Returns: this data as a bool
// ListData.asBool() as bool;myListData.asBool();
Return Type:
bool
// ListData as boolmyListData as bool
Return Type:
bool
Returns: this data as a byte
// ListData.asByte() as byte;myListData.asByte();
Return Type:
byte
// ListData as bytemyListData as byte
Return Type:
byte
Returns: this data as a double
// ListData.asDouble() as double;myListData.asDouble();
Return Type:
double
// ListData as doublemyListData as double
Return Type:
double
Returns: this data as a float
// ListData.asFloat() as float;myListData.asFloat();
Return Type:
float
// ListData as floatmyListData as float
Return Type:
float
Returns: this data as an int
// ListData.asInt() as int;myListData.asInt();
Return Type:
int
// ListData as intmyListData as int
Return Type:
int
Returns: this data as a long
// ListData.asLong() as long;myListData.asLong();
Return Type:
long
// ListData as longmyListData as long
Return Type:
long
Returns: this data as a short
// ListData.asShort() as short;myListData.asShort();
Return Type:
short
// ListData as shortmyListData as short
Return Type:
short
E.G println(("hello" as IData).asString())
prints "hello"
Returns: The escaped string version of this IData.
// ListData.asString() as string;myListData.asString();
Return Type:
string
E.G println(("hello" as IData).getAsString())
prints hello
Returns: The literal string version of this IData.
// ListData.getAsString() as string;myListData.getAsString();
Return Type:
string
E.G println(("hello" as IData).getAsString())
prints hello
// ListData as stringmyListData as string
Return Type:
string
Returns: the intenral ID of this data.
// ListData.getId() as byte;myListData.getId();
Return Type:
byte
// ListData.isEmpty as boolmyListData.isEmpty
Return Type:
bool
Returns: True if empty.
// ListData.isEmpty() as bool;myListData.isEmpty();
Return Type:
bool
This attempts to give the most accurate type for the given members, for example, if all the members are bytes, then it returns a ByteArrayData.
However if the types are mixed or do not have a *ArrayData version, then a ListData is returned.
Returns: A list of the given members.
Return Type:
IData
Returns: A new IData from the operation
myListData.map((data) => 3);
Parameters:
Return Type:
IData
// ListData.remove(key as string);myListData.remove("key");
Parameters:
key: string
Type: string
- The key to remove.