Class DamageSourcePredicate

java.lang.Object
net.minecraft.advancements.critereon.DamageSourcePredicate

public class DamageSourcePredicate extends Object
  • Field Details

    • ANY

      public static final DamageSourcePredicate ANY
    • isProjectile

      @Nullable private final Boolean isProjectile
    • isExplosion

      @Nullable private final Boolean isExplosion
    • bypassesArmor

      @Nullable private final Boolean bypassesArmor
    • bypassesInvulnerability

      @Nullable private final Boolean bypassesInvulnerability
    • bypassesMagic

      @Nullable private final Boolean bypassesMagic
    • isFire

      @Nullable private final Boolean isFire
    • isMagic

      @Nullable private final Boolean isMagic
    • isLightning

      @Nullable private final Boolean isLightning
    • directEntity

      private final EntityPredicate directEntity
    • sourceEntity

      private final EntityPredicate sourceEntity
  • Constructor Details

  • Method Details

    • matches

      public boolean matches(ServerPlayer p_25449_, DamageSource p_25450_)
    • matches

      public boolean matches(ServerLevel p_25445_, Vec3 p_25446_, DamageSource p_25447_)
    • fromJson

      public static DamageSourcePredicate fromJson(@Nullable com.google.gson.JsonElement p_25452_)
    • getOptionalBoolean

      @Nullable private static Boolean getOptionalBoolean(com.google.gson.JsonObject p_25454_, String p_25455_)
    • serializeToJson

      public com.google.gson.JsonElement serializeToJson()
    • addOptionally

      private void addOptionally(com.google.gson.JsonObject p_25457_, String p_25458_, @Nullable Boolean p_25459_)