Record Class ExplodeEffect
java.lang.Object
java.lang.Record
net.minecraft.world.item.enchantment.effects.ExplodeEffect
- All Implemented Interfaces:
EnchantmentEntityEffect,EnchantmentLocationBasedEffect
public record ExplodeEffect(boolean attributeToUser, Optional<Holder<DamageType>> damageType, Optional<LevelBasedValue> knockbackMultiplier, Optional<HolderSet<Block>> immuneBlocks, Vec3 offset, LevelBasedValue radius, boolean createFire, Level.ExplosionInteraction blockInteraction, ParticleOptions smallParticle, ParticleOptions largeParticle, Holder<SoundEvent> sound)
extends Record
implements EnchantmentEntityEffect
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanThe field for theattributeToUserrecord component.private final Level.ExplosionInteractionThe field for theblockInteractionrecord component.static final com.mojang.serialization.MapCodec<ExplodeEffect> private final booleanThe field for thecreateFirerecord component.private final Optional<Holder<DamageType>> The field for thedamageTyperecord component.The field for theimmuneBlocksrecord component.private final Optional<LevelBasedValue> The field for theknockbackMultiplierrecord component.private final ParticleOptionsThe field for thelargeParticlerecord component.private final Vec3The field for theoffsetrecord component.private final LevelBasedValueThe field for theradiusrecord component.private final ParticleOptionsThe field for thesmallParticlerecord component.private final Holder<SoundEvent> The field for thesoundrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionExplodeEffect(boolean attributeToUser, Optional<Holder<DamageType>> damageType, Optional<LevelBasedValue> knockbackMultiplier, Optional<HolderSet<Block>> immuneBlocks, Vec3 offset, LevelBasedValue radius, boolean createFire, Level.ExplosionInteraction blockInteraction, ParticleOptions smallParticle, ParticleOptions largeParticle, Holder<SoundEvent> sound) Creates an instance of aExplodeEffectrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(ServerLevel p_346186_, int p_345966_, EnchantedItemInUse p_346324_, Entity p_345305_, Vec3 p_344916_) booleanReturns the value of theattributeToUserrecord component.Returns the value of theblockInteractionrecord component.com.mojang.serialization.MapCodec<ExplodeEffect> codec()booleanReturns the value of thecreateFirerecord component.Returns the value of thedamageTyperecord component.final booleanIndicates whether some other object is "equal to" this one.private DamageSourcegetDamageSource(Entity p_346246_, Vec3 p_345332_) final inthashCode()Returns a hash code value for this object.Returns the value of theimmuneBlocksrecord component.Returns the value of theknockbackMultiplierrecord component.Returns the value of thelargeParticlerecord component.offset()Returns the value of theoffsetrecord component.radius()Returns the value of theradiusrecord component.Returns the value of thesmallParticlerecord component.sound()Returns the value of thesoundrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.item.enchantment.effects.EnchantmentEntityEffect
onChangedBlockMethods inherited from interface net.minecraft.world.item.enchantment.effects.EnchantmentLocationBasedEffect
onDeactivated
-
Field Details
-
attributeToUser
private final boolean attributeToUserThe field for theattributeToUserrecord component. -
damageType
The field for thedamageTyperecord component. -
knockbackMultiplier
The field for theknockbackMultiplierrecord component. -
immuneBlocks
The field for theimmuneBlocksrecord component. -
offset
The field for theoffsetrecord component. -
radius
The field for theradiusrecord component. -
createFire
private final boolean createFireThe field for thecreateFirerecord component. -
blockInteraction
The field for theblockInteractionrecord component. -
smallParticle
The field for thesmallParticlerecord component. -
largeParticle
The field for thelargeParticlerecord component. -
sound
The field for thesoundrecord component. -
CODEC
-
-
Constructor Details
-
ExplodeEffect
public ExplodeEffect(boolean attributeToUser, Optional<Holder<DamageType>> damageType, Optional<LevelBasedValue> knockbackMultiplier, Optional<HolderSet<Block>> immuneBlocks, Vec3 offset, LevelBasedValue radius, boolean createFire, Level.ExplosionInteraction blockInteraction, ParticleOptions smallParticle, ParticleOptions largeParticle, Holder<SoundEvent> sound) Creates an instance of aExplodeEffectrecord class.- Parameters:
attributeToUser- the value for theattributeToUserrecord componentdamageType- the value for thedamageTyperecord componentknockbackMultiplier- the value for theknockbackMultiplierrecord componentimmuneBlocks- the value for theimmuneBlocksrecord componentoffset- the value for theoffsetrecord componentradius- the value for theradiusrecord componentcreateFire- the value for thecreateFirerecord componentblockInteraction- the value for theblockInteractionrecord componentsmallParticle- the value for thesmallParticlerecord componentlargeParticle- the value for thelargeParticlerecord componentsound- the value for thesoundrecord component
-
-
Method Details
-
apply
public void apply(ServerLevel p_346186_, int p_345966_, EnchantedItemInUse p_346324_, Entity p_345305_, Vec3 p_344916_) - Specified by:
applyin interfaceEnchantmentEntityEffect
-
getDamageSource
-
codec
- Specified by:
codecin interfaceEnchantmentEntityEffect- Specified by:
codecin interfaceEnchantmentLocationBasedEffect
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
attributeToUser
public boolean attributeToUser()Returns the value of theattributeToUserrecord component.- Returns:
- the value of the
attributeToUserrecord component
-
damageType
Returns the value of thedamageTyperecord component.- Returns:
- the value of the
damageTyperecord component
-
knockbackMultiplier
Returns the value of theknockbackMultiplierrecord component.- Returns:
- the value of the
knockbackMultiplierrecord component
-
immuneBlocks
Returns the value of theimmuneBlocksrecord component.- Returns:
- the value of the
immuneBlocksrecord component
-
offset
Returns the value of theoffsetrecord component.- Returns:
- the value of the
offsetrecord component
-
radius
Returns the value of theradiusrecord component.- Returns:
- the value of the
radiusrecord component
-
createFire
public boolean createFire()Returns the value of thecreateFirerecord component.- Returns:
- the value of the
createFirerecord component
-
blockInteraction
Returns the value of theblockInteractionrecord component.- Returns:
- the value of the
blockInteractionrecord component
-
smallParticle
Returns the value of thesmallParticlerecord component.- Returns:
- the value of the
smallParticlerecord component
-
largeParticle
Returns the value of thelargeParticlerecord component.- Returns:
- the value of the
largeParticlerecord component
-
sound
Returns the value of thesoundrecord component.- Returns:
- the value of the
soundrecord component
-