Class DamageSource
java.lang.Object
net.minecraft.world.damagesource.DamageSource
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final @Nullable Entityprivate final @Nullable Vec3private final @Nullable Entityprivate final Holder<DamageType> -
Constructor Summary
ConstructorsConstructorDescriptionDamageSource(Holder<DamageType> type) DamageSource(Holder<DamageType> type, @Nullable Entity causingEntity) DamageSource(Holder<DamageType> type, @Nullable Entity directEntity, @Nullable Entity causingEntity) DamageSource(Holder<DamageType> type, @Nullable Entity directEntity, @Nullable Entity causingEntity, @Nullable Vec3 damageSourcePosition) DamageSource(Holder<DamageType> type, Vec3 damageSourcePosition) -
Method Summary
Modifier and TypeMethodDescription@Nullable Entity@Nullable EntityfloatgetLocalizedDeathMessage(LivingEntity victim) getMsgId()@Nullable Vec3@Nullable ItemStackbooleanis(ResourceKey<DamageType> typeKey) booleanis(TagKey<DamageType> tag) booleanbooleanisDirect()booleanDeprecated.@Nullable Vec3toString()type()
-
Field Details
-
type
-
causingEntity
-
directEntity
-
damageSourcePosition
-
-
Constructor Details
-
DamageSource
public DamageSource(Holder<DamageType> type, @Nullable Entity directEntity, @Nullable Entity causingEntity, @Nullable Vec3 damageSourcePosition) -
DamageSource
public DamageSource(Holder<DamageType> type, @Nullable Entity directEntity, @Nullable Entity causingEntity) -
DamageSource
-
DamageSource
-
DamageSource
-
-
Method Details
-
toString
-
getFoodExhaustion
public float getFoodExhaustion() -
isDirect
public boolean isDirect() -
getDirectEntity
-
getEntity
-
getWeaponItem
-
getLocalizedDeathMessage
-
getMsgId
-
scalesWithDifficulty
Deprecated. -
isCreativePlayer
public boolean isCreativePlayer() -
getSourcePosition
-
sourcePositionRaw
-
is
-
is
-
type
-
typeHolder
-
DamageScaling.getScalingFunction()