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.

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.loot.conditions.vanilla.Reference;

已实现的接口

Link to 已实现的接口

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

Name: withName

Sets the name of the data-pack loot condition to query.

This parameter is <strong>required</strong>.

Returns: This builder for chaining.
Return Type: Reference

ZenScript
Copy
Reference.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 <strong>required</strong>.

Returns: This builder for chaining.
Return Type: Reference

ZenScript
Copy
Reference.withName(name as string) as Reference
参数类型描述
参数
name(名称)
类型
string
描述
The name of the predicate to query, in MCResourceLocation form.