public class DamageSourcePredicate extends Object
Modifier and Type | Class and Description |
---|---|
static class |
DamageSourcePredicate.Builder |
Modifier and Type | Field and Description |
---|---|
private Boolean |
bypassesArmor |
private Boolean |
bypassesInvulnerability |
private Boolean |
bypassesMagic |
private EntityPredicate |
directEntity |
static DamageSourcePredicate |
EMPTY |
private Boolean |
isExplosion |
private Boolean |
isFire |
private Boolean |
isLightning |
private Boolean |
isMagic |
private Boolean |
isProjectile |
private EntityPredicate |
sourceEntity |
Constructor and Description |
---|
DamageSourcePredicate(Boolean isProjectile,
Boolean isExplosion,
Boolean bypassesArmor,
Boolean bypassesInvulnerability,
Boolean bypassesMagic,
Boolean isFire,
Boolean isMagic,
Boolean isLightning,
EntityPredicate directEntity,
EntityPredicate sourceEntity) |
Modifier and Type | Method and Description |
---|---|
private void |
addProperty(JsonObject json,
String key,
Boolean value) |
static DamageSourcePredicate |
fromJson(JsonElement json) |
private static Boolean |
getBoolean(JsonObject obj,
String name) |
boolean |
test(ServerPlayerEntity player,
DamageSource damageSource) |
boolean |
test(ServerWorld world,
Vec3d pos,
DamageSource damageSource) |
JsonElement |
toJson() |
public static final DamageSourcePredicate EMPTY
private final Boolean isProjectile
private final Boolean isExplosion
private final Boolean bypassesArmor
private final Boolean bypassesInvulnerability
private final Boolean bypassesMagic
private final Boolean isFire
private final Boolean isMagic
private final Boolean isLightning
private final EntityPredicate directEntity
private final EntityPredicate sourceEntity
public DamageSourcePredicate(@Nullable Boolean isProjectile, @Nullable Boolean isExplosion, @Nullable Boolean bypassesArmor, @Nullable Boolean bypassesInvulnerability, @Nullable Boolean bypassesMagic, @Nullable Boolean isFire, @Nullable Boolean isMagic, @Nullable Boolean isLightning, EntityPredicate directEntity, EntityPredicate sourceEntity)
public boolean test(ServerPlayerEntity player, DamageSource damageSource)
public boolean test(ServerWorld world, Vec3d pos, DamageSource damageSource)
public static DamageSourcePredicate fromJson(@Nullable JsonElement json)
@Nullable private static Boolean getBoolean(JsonObject obj, String name)
public JsonElement toJson()
private void addProperty(JsonObject json, String key, @Nullable Boolean value)