DamageSourcePredicate

Importing the class

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.

script.zs
import crafttweaker.api.predicate.DamageSourcePredicate;

Static Methods

Return Type: DamageSourcePredicate

script.zs
// DamageSourcePredicate.any() as DamageSourcePredicate
DamageSourcePredicate.any();

Return Type: DamageSourcePredicateBuilder

script.zs
// DamageSourcePredicate.create() as DamageSourcePredicateBuilder
DamageSourcePredicate.create();

Methods

Return Type: boolean

script.zs
DamageSourcePredicate.matches(player as ServerPlayer, source as DamageSource) as boolean
ParameterType
Parameter
player
Type
ServerPlayer
Parameter
source
Type
DamageSource

Return Type: boolean

script.zs
DamageSourcePredicate.matches(level as ServerLevel, pos as Vec3, source as DamageSource) as boolean
ParameterType
Parameter
level
Type
ServerLevel
Parameter
pos
Type
Vec3
Parameter
source
Type
DamageSource