MapData
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.MapData;
Description
Implements
MapData
implements the following interfaces:
Constructors
Operators
Members
Returns: this data as a bool
// MapData.asBool() as bool;(Hello: "World", Somewhere: "Over the rainbow").asBool();
Return Type:
bool
// MapData as bool(Hello: "World", Somewhere: "Over the rainbow") as bool
Return Type:
bool
Returns: this data as a byte
// MapData.asByte() as byte;(Hello: "World", Somewhere: "Over the rainbow").asByte();
Return Type:
byte
// MapData as byte(Hello: "World", Somewhere: "Over the rainbow") as byte
Return Type:
byte
Returns: this data as a byte array
// MapData.asByteArray() as byte[];(Hello: "World", Somewhere: "Over the rainbow").asByteArray();
Return Type:
byte[]
// MapData as byte[](Hello: "World", Somewhere: "Over the rainbow") as byte[]
Return Type:
byte[]
Returns: this data as a double
// MapData.asDouble() as double;(Hello: "World", Somewhere: "Over the rainbow").asDouble();
Return Type:
double
// MapData as double(Hello: "World", Somewhere: "Over the rainbow") as double
Return Type:
double
Returns: this data as a float
// MapData.asFloat() as float;(Hello: "World", Somewhere: "Over the rainbow").asFloat();
Return Type:
float
// MapData as float(Hello: "World", Somewhere: "Over the rainbow") as float
Return Type:
float
Returns: this data as an int
// MapData.asInt() as int;(Hello: "World", Somewhere: "Over the rainbow").asInt();
Return Type:
int
// MapData as int(Hello: "World", Somewhere: "Over the rainbow") as int
Return Type:
int
Returns: this data as an int array
// MapData.asIntArray() as int[];(Hello: "World", Somewhere: "Over the rainbow").asIntArray();
Return Type:
int[]
// MapData as int[](Hello: "World", Somewhere: "Over the rainbow") as int[]
Return Type:
int[]
Returns: this data as a long
// MapData.asLong() as long;(Hello: "World", Somewhere: "Over the rainbow").asLong();
Return Type:
long
// MapData as long(Hello: "World", Somewhere: "Over the rainbow") as long
Return Type:
long
Returns: this data as a long array
// MapData.asLongArray() as long[];(Hello: "World", Somewhere: "Over the rainbow").asLongArray();
Return Type:
long[]
// MapData as long[](Hello: "World", Somewhere: "Over the rainbow") as long[]
Return Type:
long[]
Returns: this data as a short
// MapData.asShort() as short;(Hello: "World", Somewhere: "Over the rainbow").asShort();
Return Type:
short
// MapData as short(Hello: "World", Somewhere: "Over the rainbow") as short
Return Type:
short
E.G println(("hello" as IData).asString())
prints "hello"
Returns: The escaped string version of this IData.
// MapData.asString() as string;(Hello: "World", Somewhere: "Over the rainbow").asString();
Return Type:
string
E.G println(("hello" as IData).getAsString())
prints hello
Returns: The literal string version of this IData.
// MapData.getAsString() as string;(Hello: "World", Somewhere: "Over the rainbow").getAsString();
Return Type:
string
E.G println(("hello" as IData).getAsString())
prints hello
// MapData as string(Hello: "World", Somewhere: "Over the rainbow") as string
Return Type:
string
Returns: the intenral ID of this data.
// MapData.getId() as byte;(Hello: "World", Somewhere: "Over the rainbow").getId();
Return Type:
byte
// MapData.isEmpty as bool(Hello: "World", Somewhere: "Over the rainbow").isEmpty
Return Type:
bool
Returns: True if empty.
// MapData.isEmpty() as bool;(Hello: "World", Somewhere: "Over the rainbow").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
(Hello: "World", Somewhere: "Over the rainbow").map((data) => 3);
Parameters:
Return Type:
IData
(Hello: "World", Somewhere: "Over the rainbow").putAll({Hello: "Goodbye", Item: "Bedrock"});
(Hello: "World", Somewhere: "Over the rainbow").setAt(myString, myIData);