Class AbstractDamageSourceBuilder<T extends DamageSource,B extends DamageSource.DamageSourceBuilder<T,B>>
- All Implemented Interfaces:
AbstractBuilder<T>,DamageSource.DamageSourceBuilder<T,,B> Builder<T,,B> CopyableBuilder<T,,B> ResettableBuilder<T,B>
- Direct Known Subclasses:
AbstractEntityDamageSource.AbstractEntityDamageSourceBuilder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanprotected booleanprotected DamageTypeprotected @Nullable Doubleprotected booleanprotected booleanprotected booleanprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabsolute()Sets whether thisDamageSource's damage is absolute and will ignore potion effects and enchantments.Sets thisDamageSourceas dealing damage that bypasses armor modifiers.creative()Sets thisDamageSourceas considered to damage creative, or otherwise "normally unharmable" players.exhaustion(double exhaustion) Sets the amount of exhaustion thisDamageSourcewill add to the entity, generally only to players.Sets thisDamageSourceas an explosion.fire()Sets thisDamageSource's damage to be considered "fire" damage.Resets this builder to the values of the given built object.magical()Sets thisDamageSourceas considered to be magical damage.reset()Resets this builder to a "default" state such that there is no remaining data to set.Sets thisDamageSource's damage to be scaled byDifficulty.type(DamageType damageType) Sets theDamageTypeof this source.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.spongepowered.api.event.cause.entity.damage.source.DamageSource.DamageSourceBuilder
build, type
-
Field Details
-
scales
protected boolean scales -
bypasses
protected boolean bypasses -
explosion
protected boolean explosion -
absolute
protected boolean absolute -
magical
protected boolean magical -
creative
protected boolean creative -
fire
protected boolean fire -
exhaustion
-
damageType
-
-
Constructor Details
-
AbstractDamageSourceBuilder
public AbstractDamageSourceBuilder()
-
-
Method Details
-
fire
Description copied from interface:DamageSource.DamageSourceBuilderSets thisDamageSource's damage to be considered "fire" damage.- Specified by:
firein interfaceDamageSource.DamageSourceBuilder<T extends DamageSource,B extends DamageSource.DamageSourceBuilder<T, B>> - Returns:
- This builder
-
scalesWithDifficulty
Description copied from interface:DamageSource.DamageSourceBuilderSets thisDamageSource's damage to be scaled byDifficulty.- Specified by:
scalesWithDifficultyin interfaceDamageSource.DamageSourceBuilder<T extends DamageSource,B extends DamageSource.DamageSourceBuilder<T, B>> - Returns:
- This builder
-
bypassesArmor
Description copied from interface:DamageSource.DamageSourceBuilderSets thisDamageSourceas dealing damage that bypasses armor modifiers.This sets the exhaustion increase caused by this source to 0. You can override this with
DamageSource.DamageSourceBuilder.exhaustion(double).- Specified by:
bypassesArmorin interfaceDamageSource.DamageSourceBuilder<T extends DamageSource,B extends DamageSource.DamageSourceBuilder<T, B>> - Returns:
- This builder
-
explosion
Description copied from interface:DamageSource.DamageSourceBuilderSets thisDamageSourceas an explosion.- Specified by:
explosionin interfaceDamageSource.DamageSourceBuilder<T extends DamageSource,B extends DamageSource.DamageSourceBuilder<T, B>> - Returns:
- This builder
-
absolute
Description copied from interface:DamageSource.DamageSourceBuilderSets whether thisDamageSource's damage is absolute and will ignore potion effects and enchantments.This sets the exhaustion increase caused by this source to 0. You can override this with
DamageSource.DamageSourceBuilder.exhaustion(double).- Specified by:
absolutein interfaceDamageSource.DamageSourceBuilder<T extends DamageSource,B extends DamageSource.DamageSourceBuilder<T, B>> - Returns:
- This builder
-
magical
Description copied from interface:DamageSource.DamageSourceBuilderSets thisDamageSourceas considered to be magical damage. An example is potions.- Specified by:
magicalin interfaceDamageSource.DamageSourceBuilder<T extends DamageSource,B extends DamageSource.DamageSourceBuilder<T, B>> - Returns:
- This builder
-
creative
Description copied from interface:DamageSource.DamageSourceBuilderSets thisDamageSourceas considered to damage creative, or otherwise "normally unharmable" players.- Specified by:
creativein interfaceDamageSource.DamageSourceBuilder<T extends DamageSource,B extends DamageSource.DamageSourceBuilder<T, B>> - Returns:
- This builder
-
exhaustion
Description copied from interface:DamageSource.DamageSourceBuilderSets the amount of exhaustion thisDamageSourcewill add to the entity, generally only to players.In vanilla gameplay, the default is 0.1, unless if the damage is absolute or bypasses armor, where the exhaustion gets set to 0. This builder follows this mechanic, but if you set the exhaustion through this method that will be overridden.
If you don't set this exhaustion manually, calling
DamageSource.DamageSourceBuilder.absolute()orDamageSource.DamageSourceBuilder.bypassesArmor()will set this 0 and if you don't this will default to 0.1.- Specified by:
exhaustionin interfaceDamageSource.DamageSourceBuilder<T extends DamageSource,B extends DamageSource.DamageSourceBuilder<T, B>> - Parameters:
exhaustion- The amount of exhaustion to add to the entity- Returns:
- This builder
-
type
Description copied from interface:DamageSource.DamageSourceBuilderSets theDamageTypeof this source.This is required to be set.
- Specified by:
typein interfaceDamageSource.DamageSourceBuilder<T extends DamageSource,B extends DamageSource.DamageSourceBuilder<T, B>> - Parameters:
damageType- The desired damage type- Returns:
- This builder
-
from
Description copied from interface:CopyableBuilderResets this builder to the values of the given built object.- Specified by:
fromin interfaceCopyableBuilder<T extends DamageSource,B extends DamageSource.DamageSourceBuilder<T, B>> - Parameters:
value- The built object- Returns:
- This builder, for chaining
-
reset
Description copied from interface:BuilderResets this builder to a "default" state such that there is no remaining data to set. This is to be the presumed "default" state.- Specified by:
resetin interfaceBuilder<T extends DamageSource,B extends DamageSource.DamageSourceBuilder<T, B>> - Specified by:
resetin interfaceResettableBuilder<T extends DamageSource,B extends DamageSource.DamageSourceBuilder<T, B>> - Returns:
- This builder, for chaining
-