Reference
Link to reference
Builder for a 'Reference' loot condition.
A Reference condition defers checking to another loot condition, identified by the given MCResourceLocation, that acts as the name of the additional condition. This allows additional conditions that may have been created in a data-pack to be referred by other conditions, created from within scripts.
This condition acts as the vanilla counterpart of the Delegate loot condition, providing support only for data-packs instead of scripts.
A 'Reference' loot condition requires the name of the condition to call to be built correctly.
导入类
Link to 导入类
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 Copyimport crafttweaker.api.loot.conditions.vanilla.Reference;
已实现的接口
Link to 已实现的接口
Reference implements the following interfaces. That means all methods defined in these interfaces are also available in Reference
使用方式
Link to 使用方式
Name: withName
Sets the name of the data-pack loot condition to query.
This parameter is required.
Returns: This builder for chaining.
Return Type: Reference
ZenScript CopyReference.withName(name as MCResourceLocation) as Reference
参数 | 类型 | 描述 |
---|---|---|
参数 name(名称) | 类型 MCResourceLocation | 描述 The name of the predicate to query. |
Name: withName
Sets the name of the data-pack loot condition to query.
The name is treated as a MCResourceLocation, lacking the type safety of the bracket handler. For this reason, it's suggested to prefer the method with a MCResourceLocation as parameter.
This parameter is required.
Returns: This builder for chaining.
Return Type: Reference
ZenScript CopyReference.withName(name as string) as Reference
参数 | 类型 | 描述 |
---|---|---|
参数 name(名称) | 类型 string | 描述 The name of the predicate to query, in MCResourceLocation form. |