public class DamagePredicate extends Object
Modifier and Type | Class and Description |
---|---|
static class |
DamagePredicate.Builder |
Modifier and Type | Field and Description |
---|---|
static DamagePredicate |
ANY |
private Boolean |
blocked |
private NumberRange.FloatRange |
dealt |
private EntityPredicate |
sourceEntity |
private NumberRange.FloatRange |
taken |
private DamageSourcePredicate |
type |
Constructor and Description |
---|
DamagePredicate() |
DamagePredicate(NumberRange.FloatRange dealt,
NumberRange.FloatRange taken,
EntityPredicate sourceEntity,
Boolean blocked,
DamageSourcePredicate type) |
Modifier and Type | Method and Description |
---|---|
static DamagePredicate |
fromJson(JsonElement json) |
boolean |
test(ServerPlayerEntity player,
DamageSource source,
float dealt,
float taken,
boolean blocked) |
JsonElement |
toJson() |
public static final DamagePredicate ANY
private final NumberRange.FloatRange dealt
private final NumberRange.FloatRange taken
private final EntityPredicate sourceEntity
private final Boolean blocked
private final DamageSourcePredicate type
public DamagePredicate()
public DamagePredicate(NumberRange.FloatRange dealt, NumberRange.FloatRange taken, EntityPredicate sourceEntity, @Nullable Boolean blocked, DamageSourcePredicate type)
public boolean test(ServerPlayerEntity player, DamageSource source, float dealt, float taken, boolean blocked)
public static DamagePredicate fromJson(@Nullable JsonElement json)
public JsonElement toJson()