Builder for a 'LocationCheck' loot condition.

This condition checks the location at which a specific loot table has been rolled, barring a user-specified offset, as obtained via the LootContext. The check is performed according to the specified LocationPredicate.

The condition passes when the origin location of the loot table passes the checks of the predicate, after having been offset by the amount specified by the user, if present.

If no predicate is specified, the condition simply acts as a check on whether an origin location is available or not.

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.LocationCheck;

Interfacce Implementate

Link to interfacce-implementate

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

Link to withLocationPredicate

Name: withLocationPredicate

Creates and sets the LocationPredicate that will be matched against the offset location.

Any changes that have already been made to the predicate will be overwritten, effectively replacing the previous predicate, if any.

This parameter is optional.

Returns: This builder for chaining.
Return Type: LocationCheck

ZenScript
Copy
LocationCheck.withLocationPredicate(builder as Consumer<LocationPredicate>) as LocationCheck
ParametroTipoDescrizione
Parametro
costruttore
Tipo
Consumer<LocationPredicate>
Descrizione
A consumer that will be used to configure the LocationPredicate.

Name: withOffset

Sets the offset which should be used to offset the location prior to the predicate check.

This parameter is optional.

Returns: This builder for chaining.
Return Type: LocationCheck

ZenScript
Copy
LocationCheck.withOffset(pos as BlockPos) as LocationCheck
ParametroTipoDescrizione
Parametro
pos
Tipo
BlockPos
Descrizione
The offset that should be applied.

Name: withXOffset

Sets the offset along the X axis that should be used to offset the location prior to the predicate check.

If an offset has already been specified along any other axis, the offset along those axis is preserved. On the other hand, any previous offset that had already been set on this axis will be overwritten.

This parameter is optional.

Returns: This builder for chaining.
Return Type: LocationCheck

ZenScript
Copy
LocationCheck.withXOffset(x as int) as LocationCheck
ParametroTipoDescrizione
Parametro
x
Tipo
int
Descrizione
The offset that should be applied to the X axis.

Name: withYOffset

Sets the offset along the Y axis that should be used to offset the location prior to the predicate check.

If an offset has already been specified along any other axis, the offset along those axis is preserved. On the other hand, any previous offset that had already been set on this axis will be overwritten.

This parameter is optional.

Returns: This builder for chaining.
Return Type: LocationCheck

ZenScript
Copy
LocationCheck.withYOffset(y as int) as LocationCheck
ParametroTipoDescrizione
Parametro
y
Tipo
int
Descrizione
The offset that should be applied to the Y axis.

Name: withZOffset

Sets the offset along the Z axis that should be used to offset the location prior to the predicate check.

If an offset has already been specified along any other axis, the offset along those axis is preserved. On the other hand, any previous offset that had already been set on this axis will be overwritten.

This parameter is optional.

Returns: This builder for chaining.
Return Type: LocationCheck

ZenScript
Copy
LocationCheck.withZOffset(z as int) as LocationCheck
ParametroTipoDescrizione
Parametro
z
Tipo
int
Descrizione
The offset that should be applied to the Z axis.