Home Migration Guide Getting Started With Scripts Commands Examples
BracketHandlers

MCResourceLocation

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.util.MCResourceLocation;

Implemented Interfaces

MCResourceLocation implements the following interfaces. That means all methods defined in these interfaces are also available in MCResourceLocation

Constructors

script.zs
new MCResourceLocation(namespace as string, path as string) as MCResourceLocation
ParameterTypeDescription
Parameter
namespace
Type
string
Description
Usually a ModId
Parameter
path
Type
string
Description
May only contain lower-cased alphanumeric values, as well as / and _

Casters

Result typeIs Implicit
Result type
IData
Is Implicit
true
Result type
string
Is Implicit
true

Methods

Return Type: IData

script.zs
// MCResourceLocation.asData() as IData
myMCResourceLocation.asData();

Return Type: int

script.zs
MCResourceLocation.compareTo(other as MCResourceLocation) as int
ParameterTypeDescription
Parameter
other
Type
MCResourceLocation
Description
No Description Provided

Return Type: boolean

script.zs
MCResourceLocation.equals(other as Object) as boolean
ParameterTypeDescription
Parameter
other
Type
Object
Description
No Description Provided

Return Type: string

script.zs
// MCResourceLocation.getNamespace() as string
myMCResourceLocation.getNamespace();

Return Type: string

script.zs
// MCResourceLocation.getPath() as string
myMCResourceLocation.getPath();

Return Type: int

script.zs
// MCResourceLocation.hashCode() as int
myMCResourceLocation.hashCode();

Return Type: string

script.zs
// MCResourceLocation.toString() as string
myMCResourceLocation.toString();

Properties

NameTypeHas GetterHas SetterDescription
Name
commandString
Type
string
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
namespace
Type
string
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
path
Type
string
Has Getter
true
Has Setter
false
Description
No Description Provided