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.

ZenScript
Copy
import crafttweaker.api.resource.ResourceLocation;

已实现的接口

Link to 已实现的接口

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

Constructor #构造函数

Link to constructor-构造函数

ZenScript
Copy
new ResourceLocation(namespace as string, path as string) as ResourceLocation
参数类型描述
参数
命名空间
类型
string
描述
Usually a ModId
参数
path
类型
string
描述
May only contain lower-cased alphanumeric values, as well as / and _
Result Type是否隐藏
Result Type
IData #数据
是否隐藏
true
Result Type
string
是否隐藏
true

Name: asData

Return Type: IData

ZenScript
Copy
// ResourceLocation.asData() as IData

myResourceLocation.asData();

Name: compareTo

Return Type: int

ZenScript
Copy
ResourceLocation.compareTo(other as ResourceLocation) as int
参数类型
参数
other
类型
资源位置

Name: equals

Return Type: boolean

ZenScript
Copy
ResourceLocation.equals(other as Object) as boolean
参数类型
参数
other
类型
Object

Name: getNamespace

Return Type: string

ZenScript
Copy
// ResourceLocation.getNamespace() as string

myResourceLocation.getNamespace();

Name: getPath

Return Type: string

ZenScript
Copy
// ResourceLocation.getPath() as string

myResourceLocation.getPath();

Name: hashCode

Return Type: int

ZenScript
Copy
// ResourceLocation.hashCode() as int

myResourceLocation.hashCode();

Name: toString

Return Type: string

ZenScript
Copy
// ResourceLocation.toString() as string

myResourceLocation.toString();
名称类型可获得可设置
名称
commandString #命令字符串
类型
string
可获得
true
可设置
false
名称
命名空间
类型
string
可获得
true
可设置
false
名称
path
类型
string
可获得
true
可设置
false