Class DamageSource

java.lang.Object
net.minecraft.world.damagesource.DamageSource
Direct Known Subclasses:
BadRespawnPointDamage, EntityDamageSource

public class DamageSource extends Object
  • Field Details

    • IN_FIRE

      public static final DamageSource IN_FIRE
    • LIGHTNING_BOLT

      public static final DamageSource LIGHTNING_BOLT
    • ON_FIRE

      public static final DamageSource ON_FIRE
    • LAVA

      public static final DamageSource LAVA
    • HOT_FLOOR

      public static final DamageSource HOT_FLOOR
    • IN_WALL

      public static final DamageSource IN_WALL
    • CRAMMING

      public static final DamageSource CRAMMING
    • DROWN

      public static final DamageSource DROWN
    • STARVE

      public static final DamageSource STARVE
    • CACTUS

      public static final DamageSource CACTUS
    • FALL

      public static final DamageSource FALL
    • FLY_INTO_WALL

      public static final DamageSource FLY_INTO_WALL
    • OUT_OF_WORLD

      public static final DamageSource OUT_OF_WORLD
    • GENERIC

      public static final DamageSource GENERIC
    • MAGIC

      public static final DamageSource MAGIC
    • WITHER

      public static final DamageSource WITHER
    • ANVIL

      public static final DamageSource ANVIL
    • FALLING_BLOCK

      public static final DamageSource FALLING_BLOCK
    • DRAGON_BREATH

      public static final DamageSource DRAGON_BREATH
    • DRY_OUT

      public static final DamageSource DRY_OUT
    • SWEET_BERRY_BUSH

      public static final DamageSource SWEET_BERRY_BUSH
    • FREEZE

      public static final DamageSource FREEZE
    • FALLING_STALACTITE

      public static final DamageSource FALLING_STALACTITE
    • STALAGMITE

      public static final DamageSource STALAGMITE
    • damageHelmet

      private boolean damageHelmet
    • bypassArmor

      private boolean bypassArmor
    • bypassInvul

      private boolean bypassInvul
    • bypassMagic

      private boolean bypassMagic
    • exhaustion

      private float exhaustion
    • isFireSource

      private boolean isFireSource
    • isProjectile

      private boolean isProjectile
    • scalesWithDifficulty

      private boolean scalesWithDifficulty
    • isMagic

      private boolean isMagic
    • isExplosion

      private boolean isExplosion
    • isFall

      private boolean isFall
    • noAggro

      private boolean noAggro
    • msgId

      public final String msgId
  • Constructor Details

    • DamageSource

      public DamageSource(String p_19333_)
  • Method Details

    • sting

      public static DamageSource sting(LivingEntity p_19365_)
    • mobAttack

      public static DamageSource mobAttack(LivingEntity p_19371_)
    • indirectMobAttack

      public static DamageSource indirectMobAttack(Entity p_19341_, @Nullable LivingEntity p_19342_)
    • playerAttack

      public static DamageSource playerAttack(Player p_19345_)
    • arrow

      public static DamageSource arrow(AbstractArrow p_19347_, @Nullable Entity p_19348_)
    • trident

      public static DamageSource trident(Entity p_19338_, @Nullable Entity p_19339_)
    • fireworks

      public static DamageSource fireworks(FireworkRocketEntity p_19353_, @Nullable Entity p_19354_)
    • fireball

      public static DamageSource fireball(Fireball p_19350_, @Nullable Entity p_19351_)
    • witherSkull

      public static DamageSource witherSkull(WitherSkull p_19356_, Entity p_19357_)
    • thrown

      public static DamageSource thrown(Entity p_19362_, @Nullable Entity p_19363_)
    • indirectMagic

      public static DamageSource indirectMagic(Entity p_19368_, @Nullable Entity p_19369_)
    • thorns

      public static DamageSource thorns(Entity p_19336_)
    • explosion

      public static DamageSource explosion(@Nullable Explosion p_19359_)
    • explosion

      public static DamageSource explosion(@Nullable LivingEntity p_19374_)
    • badRespawnPointExplosion

      public static DamageSource badRespawnPointExplosion()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isProjectile

      public boolean isProjectile()
    • setProjectile

      public DamageSource setProjectile()
    • isExplosion

      public boolean isExplosion()
    • setExplosion

      public DamageSource setExplosion()
    • isBypassArmor

      public boolean isBypassArmor()
    • isDamageHelmet

      public boolean isDamageHelmet()
    • getFoodExhaustion

      public float getFoodExhaustion()
    • isBypassInvul

      public boolean isBypassInvul()
    • isBypassMagic

      public boolean isBypassMagic()
    • getDirectEntity

      @Nullable public Entity getDirectEntity()
    • getEntity

      @Nullable public Entity getEntity()
    • bypassArmor

      public DamageSource bypassArmor()
    • damageHelmet

      public DamageSource damageHelmet()
    • bypassInvul

      public DamageSource bypassInvul()
    • bypassMagic

      public DamageSource bypassMagic()
    • setIsFire

      public DamageSource setIsFire()
    • setNoAggro

      public DamageSource setNoAggro()
    • getLocalizedDeathMessage

      public Component getLocalizedDeathMessage(LivingEntity p_19343_)
    • isFire

      public boolean isFire()
    • isNoAggro

      public boolean isNoAggro()
    • getMsgId

      public String getMsgId()
    • setScalesWithDifficulty

      public DamageSource setScalesWithDifficulty()
    • scalesWithDifficulty

      public boolean scalesWithDifficulty()
    • isMagic

      public boolean isMagic()
    • setMagic

      public DamageSource setMagic()
    • isFall

      public boolean isFall()
    • setIsFall

      public DamageSource setIsFall()
    • isCreativePlayer

      public boolean isCreativePlayer()
    • getSourcePosition

      @Nullable public Vec3 getSourcePosition()