DamageSourceProperties

Link to damagesourceproperties

Builder to create a 'DamageSourceProperties' loot condition.

This condition checks the DamageSource obtained from the LootContext, along with additional relevant data, such as origin and world, according to the given DamageSourcePredicate.

The condition then passes if and only if the predicate used when building it marks the damage source as valid.

If no predicate is specified, the condition simply acts as a check for the presence of a DamageSource.

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

Interfacce Implementate

Link to interfacce-implementate

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

Name: withPredicate

Creates and sets the DamageSourcePredicate that will be matched against the damage source.

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: DamageSourceProperties

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