Class DamageSource

java.lang.Object
net.minecraft.world.damagesource.DamageSource

public class DamageSource extends Object
  • Field Details

    • type

      private final Holder<DamageType> type
    • causingEntity

      @Nullable private final Entity causingEntity
    • directEntity

      @Nullable private final Entity directEntity
    • damageSourcePosition

      @Nullable private final Vec3 damageSourcePosition
  • Constructor Details

  • Method Details

    • toString

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

      public float getFoodExhaustion()
    • isDirect

      public boolean isDirect()
    • getDirectEntity

      @Nullable public Entity getDirectEntity()
    • getEntity

      @Nullable public Entity getEntity()
    • getWeaponItem

      @Nullable public ItemStack getWeaponItem()
    • getLocalizedDeathMessage

      public Component getLocalizedDeathMessage(LivingEntity p_19343_)
    • getMsgId

      public String getMsgId()
    • scalesWithDifficulty

      @Deprecated(since="1.20.1") public boolean scalesWithDifficulty()
    • isCreativePlayer

      public boolean isCreativePlayer()
    • getSourcePosition

      @Nullable public Vec3 getSourcePosition()
    • sourcePositionRaw

      @Nullable public Vec3 sourcePositionRaw()
    • is

      public boolean is(TagKey<DamageType> p_270890_)
    • is

      public boolean is(ResourceKey<DamageType> p_276108_)
    • type

      public DamageType type()
    • typeHolder

      public Holder<DamageType> typeHolder()