Class DamageUtils

java.lang.Object
meteordevelopment.meteorclient.utils.entity.DamageUtils

public class DamageUtils extends Object
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final record 
     
    static interface 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    It is recommended to use this DamageUtils.RaycastFactory unless you implement custom behaviour, as soon:tm: it will be the target of optimizations to make it more performant.
  • Method Summary

    Modifier and Type
    Method
    Description
    static float
    anchorDamage(net.minecraft.entity.LivingEntity target, net.minecraft.util.math.Vec3d anchor)
     
    static float
    anchorDamage(net.minecraft.entity.LivingEntity target, net.minecraft.util.math.Vec3d targetPos, net.minecraft.util.math.Box targetBox, net.minecraft.util.math.Vec3d explosionPos, DamageUtils.RaycastFactory raycastFactory)
     
    static float
    bedDamage(net.minecraft.entity.LivingEntity target, net.minecraft.util.math.Vec3d bed)
     
    static float
    bedDamage(net.minecraft.entity.LivingEntity target, net.minecraft.util.math.Vec3d targetPos, net.minecraft.util.math.Box targetBox, net.minecraft.util.math.Vec3d explosionPos, DamageUtils.RaycastFactory raycastFactory)
     
    static float
    calculateReductions(float damage, net.minecraft.entity.LivingEntity entity, net.minecraft.entity.damage.DamageSource damageSource)
     
    static float
    crystalDamage(net.minecraft.entity.LivingEntity target, net.minecraft.util.math.Vec3d crystal)
     
    static float
    crystalDamage(net.minecraft.entity.LivingEntity target, net.minecraft.util.math.Vec3d crystal, boolean predictMovement, net.minecraft.util.math.BlockPos obsidianPos)
    Meteor Client implementations
    static float
    crystalDamage(net.minecraft.entity.LivingEntity target, net.minecraft.util.math.Vec3d targetPos, net.minecraft.util.math.Box targetBox, net.minecraft.util.math.Vec3d explosionPos, DamageUtils.RaycastFactory raycastFactory)
     
    static float
    explosionDamage(net.minecraft.entity.LivingEntity target, net.minecraft.util.math.Vec3d targetPos, net.minecraft.util.math.Box targetBox, net.minecraft.util.math.Vec3d explosionPos, float power, DamageUtils.RaycastFactory raycastFactory)
    Low level control of parameters without having to reimplement everything, for addon authors who wish to use their own predictions or other systems.
    static float
    fallDamage(net.minecraft.entity.LivingEntity entity)
     
    static float
    getAttackDamage(net.minecraft.entity.LivingEntity attacker, net.minecraft.entity.LivingEntity target)
     
    static float
    getAttackDamage(net.minecraft.entity.LivingEntity attacker, net.minecraft.entity.LivingEntity target, net.minecraft.item.ItemStack weapon)
     
    getOverridingHitFactory(net.minecraft.util.math.BlockPos overridePos, net.minecraft.block.BlockState overrideState)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • HIT_FACTORY

      public static final DamageUtils.RaycastFactory HIT_FACTORY
      It is recommended to use this DamageUtils.RaycastFactory unless you implement custom behaviour, as soon:tm: it will be the target of optimizations to make it more performant.
      See Also:
      • BlockView.raycast(RaycastContext)
  • Method Details

    • crystalDamage

      public static float crystalDamage(net.minecraft.entity.LivingEntity target, net.minecraft.util.math.Vec3d targetPos, net.minecraft.util.math.Box targetBox, net.minecraft.util.math.Vec3d explosionPos, DamageUtils.RaycastFactory raycastFactory)
    • bedDamage

      public static float bedDamage(net.minecraft.entity.LivingEntity target, net.minecraft.util.math.Vec3d targetPos, net.minecraft.util.math.Box targetBox, net.minecraft.util.math.Vec3d explosionPos, DamageUtils.RaycastFactory raycastFactory)
    • anchorDamage

      public static float anchorDamage(net.minecraft.entity.LivingEntity target, net.minecraft.util.math.Vec3d targetPos, net.minecraft.util.math.Box targetBox, net.minecraft.util.math.Vec3d explosionPos, DamageUtils.RaycastFactory raycastFactory)
    • explosionDamage

      public static float explosionDamage(net.minecraft.entity.LivingEntity target, net.minecraft.util.math.Vec3d targetPos, net.minecraft.util.math.Box targetBox, net.minecraft.util.math.Vec3d explosionPos, float power, DamageUtils.RaycastFactory raycastFactory)
      Low level control of parameters without having to reimplement everything, for addon authors who wish to use their own predictions or other systems.
      See Also:
      • ExplosionBehavior.calculateDamage(Explosion, Entity)
    • crystalDamage

      public static float crystalDamage(net.minecraft.entity.LivingEntity target, net.minecraft.util.math.Vec3d crystal, boolean predictMovement, net.minecraft.util.math.BlockPos obsidianPos)
      Meteor Client implementations
    • crystalDamage

      public static float crystalDamage(net.minecraft.entity.LivingEntity target, net.minecraft.util.math.Vec3d crystal)
    • bedDamage

      public static float bedDamage(net.minecraft.entity.LivingEntity target, net.minecraft.util.math.Vec3d bed)
    • anchorDamage

      public static float anchorDamage(net.minecraft.entity.LivingEntity target, net.minecraft.util.math.Vec3d anchor)
    • getOverridingHitFactory

      public static DamageUtils.RaycastFactory getOverridingHitFactory(net.minecraft.util.math.BlockPos overridePos, net.minecraft.block.BlockState overrideState)
    • getAttackDamage

      public static float getAttackDamage(net.minecraft.entity.LivingEntity attacker, net.minecraft.entity.LivingEntity target)
      See Also:
      • PlayerEntity.attack(Entity)
    • getAttackDamage

      public static float getAttackDamage(net.minecraft.entity.LivingEntity attacker, net.minecraft.entity.LivingEntity target, net.minecraft.item.ItemStack weapon)
    • fallDamage

      public static float fallDamage(net.minecraft.entity.LivingEntity entity)
      See Also:
      • (float, float, DamageSource)
    • calculateReductions

      public static float calculateReductions(float damage, net.minecraft.entity.LivingEntity entity, net.minecraft.entity.damage.DamageSource damageSource)
      See Also:
      • LivingEntity.applyDamage(DamageSource, float)