Class DamageTypeBuilder
java.lang.Object
com.simibubi.create.foundation.damageTypes.DamageTypeBuilder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected net.minecraft.world.damagesource.DeathMessageTypeprotected net.minecraft.world.damagesource.DamageEffectsprotected floatprotected final net.minecraft.resources.ResourceKey<net.minecraft.world.damagesource.DamageType> protected Stringprotected net.minecraft.world.damagesource.DamageScaling -
Constructor Summary
ConstructorsConstructorDescriptionDamageTypeBuilder(net.minecraft.resources.ResourceKey<net.minecraft.world.damagesource.DamageType> key) -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.damagesource.DamageTypebuild()deathMessageType(net.minecraft.world.damagesource.DeathMessageType deathMessageType) Set the death message type of this damage type.effects(net.minecraft.world.damagesource.DamageEffects effects) Set the effects of this type.exhaustion(float exhaustion) Set the exhaustion of this type.Set the message ID.net.minecraft.world.damagesource.DamageTyperegister(net.minecraft.data.worldgen.BootstrapContext<net.minecraft.world.damagesource.DamageType> ctx) scaling(net.minecraft.world.damagesource.DamageScaling scaling) Set the scaling of this type.
-
Field Details
-
key
protected final net.minecraft.resources.ResourceKey<net.minecraft.world.damagesource.DamageType> key -
msgId
-
scaling
protected net.minecraft.world.damagesource.DamageScaling scaling -
exhaustion
protected float exhaustion -
effects
protected net.minecraft.world.damagesource.DamageEffects effects -
deathMessageType
protected net.minecraft.world.damagesource.DeathMessageType deathMessageType
-
-
Constructor Details
-
DamageTypeBuilder
public DamageTypeBuilder(net.minecraft.resources.ResourceKey<net.minecraft.world.damagesource.DamageType> key)
-
-
Method Details
-
msgId
Set the message ID. this is used for death message lang keys.- See Also:
-
simpleMsgId
-
scaling
Set the scaling of this type. This determines whether damage is increased based on difficulty or not. -
exhaustion
Set the exhaustion of this type. This is the amount of hunger that will be consumed when an entity is damaged. -
effects
Set the effects of this type. This determines the sound that plays when damaged. -
deathMessageType
public DamageTypeBuilder deathMessageType(net.minecraft.world.damagesource.DeathMessageType deathMessageType) Set the death message type of this damage type. This determines how a death message lang key is assembled.DeathMessageType.DEFAULT:DamageSource.getLocalizedDeathMessage(net.minecraft.world.entity.LivingEntity)DeathMessageType.FALL_VARIANTS:CombatTracker.getFallMessage(CombatEntry, Entity)DeathMessageType.INTENTIONAL_GAME_DESIGN: "death.attack." + msgId, wrapped in brackets, linking to MCPE-28723
-
build
public net.minecraft.world.damagesource.DamageType build() -
register
public net.minecraft.world.damagesource.DamageType register(net.minecraft.data.worldgen.BootstrapContext<net.minecraft.world.damagesource.DamageType> ctx)
-