Class DamageTypeBuilder

java.lang.Object
com.simibubi.create.foundation.damageTypes.DamageTypeBuilder

public class DamageTypeBuilder extends Object
  • Field Details

    • key

      protected final net.minecraft.resources.ResourceKey<net.minecraft.world.damagesource.DamageType> key
    • msgId

      protected String 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

      public DamageTypeBuilder msgId(String msgId)
      Set the message ID. this is used for death message lang keys.
      See Also:
    • simpleMsgId

      public DamageTypeBuilder simpleMsgId()
    • scaling

      public DamageTypeBuilder scaling(net.minecraft.world.damagesource.DamageScaling scaling)
      Set the scaling of this type. This determines whether damage is increased based on difficulty or not.
    • exhaustion

      public DamageTypeBuilder exhaustion(float exhaustion)
      Set the exhaustion of this type. This is the amount of hunger that will be consumed when an entity is damaged.
    • effects

      public DamageTypeBuilder effects(net.minecraft.world.damagesource.DamageEffects 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)