MapData
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.
Implemented Interfaces
MapData implements the following interfaces. That means all methods defined in these interfaces are also available in MapData
Constructors
No Description Provided
No Description Provided
Parameter | Type | Description |
---|---|---|
Parameter map | Type IData[string] | Description No Description Provided |
Casters
Result type | Is Implicit |
---|---|
Result type boolean | Is Implicit false |
Result type ICollectionData | Is Implicit false |
Result type IData[string] | Is Implicit true |
Result type INumberData | Is Implicit false |
Methods
Return Type: boolean
Return Type: ICollectionData
Return Type: MCTextComponent
Parameter | Type | Description |
---|---|---|
Parameter indentation | Type string | Description No Description Provided |
Parameter indentDepth | Type int | Description No Description Provided |
Return Type: INumberData
Checks if the Map contains the given key.
Returns: True if the Map contains the key
Return Type: boolean
Parameter | Type | Description |
---|---|---|
Parameter key | Type string | Description The key to search for |
Retrieves the value associated with the key
Returns: The value if present, null otherwise
Return Type: IData?
Parameter | Type | Description |
---|---|---|
Parameter key | Type string | Description The key to search for |
Return Type: T
Parameter | Type | Description |
---|---|---|
Parameter key | Type string | Description No Description Provided |
Parameter T | Type IData | Description No Description Provided |
Gets the ID of the internal NBT tag.
Used to determine what NBT type is stored (in a list for example)
Returns: ID of the NBT tag that this data represents.
Return Type: byte
Gets the String representation of the internal INBT tag
Returns: String that represents the internal INBT of this IData.
Return Type: string
Merges this map and the other map. If entries from this map and the other map share the values are tried to be merged. If that does not work, then the value from the other map is used.
Returns: This map, after the merge
Return Type: MapData
Parameter | Type | Description |
---|---|---|
Parameter other | Type MapData | Description The other map. |
Adds sets the value for the given key or creates a new entry if it did not exist before.
Returns: The previous value if present, null otherwise
Return Type: IData?
Parameter | Type | Description |
---|---|---|
Parameter key | Type string | Description The key to set the value for. |
Parameter value | Type IData | Description The value to set. |
Adds all entries from the given map into this one. Can override existing keys.
Return Type: void
Parameter | Type | Description |
---|---|---|
Parameter map | Type IData[string] | Description The other entries to be added to this map |
Removes the entry with the given key from the Map
Return Type: void
Parameter | Type | Description |
---|---|---|
Parameter key | Type string | Description The key of the entry to remove |
Operators
Adds all entries from the given IData to this entry
Checks if the Map contains the given key.
Retrieves the value associated with the key
Adds sets the value for the given key or creates a new entry if it did not exist before.
Properties
Name | Type | Has Getter | Has Setter | Description |
---|---|---|---|---|
Name isEmpty | Type boolean | Has Getter true | Has Setter false | Description No Description Provided |
Name keySet | Type Set<string> | Has Getter true | Has Setter false | Description No Description Provided |
Name size | Type int | Has Getter true | Has Setter false | Description No Description Provided |