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.

Importare la Classe

Link to importare-la-classe

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;

Interfacce Implementate

Link to interfacce-implementate

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

Link to g-

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
Copy
Reference.withName(name as MCResourceLocation) as Reference
ParametroTipoDescrizione
Parametro
nome
Tipo
MCResourceLocation
Descrizione
The name of the predicate to query.

Link to g--1

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
Copy
Reference.withName(name as string) as Reference
ParametroTipoDescrizione
Parametro
nome
Tipo
string
Descrizione
The name of the predicate to query, in MCResourceLocation form.