Class DamageSourcePredicate

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

public class DamageSourcePredicate extends Object
  • Field Details

    • ANY

      public static final DamageSourcePredicate ANY
    • isProjectile

      private final Boolean isProjectile
    • isExplosion

      private final Boolean isExplosion
    • bypassesArmor

      private final Boolean bypassesArmor
    • bypassesInvulnerability

      private final Boolean bypassesInvulnerability
    • bypassesMagic

      private final Boolean bypassesMagic
    • isFire

      private final Boolean isFire
    • isMagic

      private final Boolean isMagic
    • isLightning

      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_)