Home Commands Examples Getting Started With Scripts Global Keywords
BracketDumpers BracketHandlers BracketValidators ResourceLocationBracketHandler

ResourceLocation

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.resource.ResourceLocation;

Implemented Interfaces

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

Constructors

script.zs
new ResourceLocation(namespace as string, path as string) as ResourceLocation
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
// ResourceLocation.asData() as IData
myResourceLocation.asData();

Return Type: int

script.zs
ResourceLocation.compareTo(other as ResourceLocation) as int
ParameterType
Parameter
other
Type
ResourceLocation

Return Type: boolean

script.zs
ResourceLocation.equals(other as Object) as boolean
ParameterType
Parameter
other
Type
Object

Return Type: string

script.zs
// ResourceLocation.getNamespace() as string
myResourceLocation.getNamespace();

Return Type: string

script.zs
// ResourceLocation.getPath() as string
myResourceLocation.getPath();

Return Type: int

script.zs
// ResourceLocation.hashCode() as int
myResourceLocation.hashCode();

Return Type: string

script.zs
// ResourceLocation.toString() as string
myResourceLocation.toString();

Properties

NameTypeHas GetterHas Setter
Name
commandString
Type
string
Has Getter
true
Has Setter
false
Name
namespace
Type
string
Has Getter
true
Has Setter
false
Name
path
Type
string
Has Getter
true
Has Setter
false