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
Modifier and TypeFieldDescriptionprivate final boolean
The field for theattributeToUser
record component.private final Level.ExplosionInteraction
The field for theblockInteraction
record component.static final com.mojang.serialization.MapCodec
<ExplodeEffect> private final boolean
The field for thecreateFire
record component.private final Optional
<Holder<DamageType>> The field for thedamageType
record component.The field for theimmuneBlocks
record component.private final Optional
<LevelBasedValue> The field for theknockbackMultiplier
record component.private final ParticleOptions
The field for thelargeParticle
record component.private final Vec3
The field for theoffset
record component.private final LevelBasedValue
The field for theradius
record component.private final ParticleOptions
The field for thesmallParticle
record component.private final Holder
<SoundEvent> The field for thesound
record component. -
Constructor Summary
ConstructorDescriptionExplodeEffect
(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 aExplodeEffect
record class. -
Method Summary
Modifier and TypeMethodDescriptionvoid
apply
(ServerLevel p_343276_, int p_344767_, EnchantedItemInUse p_342948_, Entity p_344263_, Vec3 p_343582_) boolean
Returns the value of theattributeToUser
record component.Returns the value of theblockInteraction
record component.com.mojang.serialization.MapCodec
<ExplodeEffect> codec()
boolean
Returns the value of thecreateFire
record component.Returns the value of thedamageType
record component.final boolean
Indicates whether some other object is "equal to" this one.private DamageSource
getDamageSource
(Entity p_343933_, Vec3 p_345099_) final int
hashCode()
Returns a hash code value for this object.Returns the value of theimmuneBlocks
record component.Returns the value of theknockbackMultiplier
record component.Returns the value of thelargeParticle
record component.offset()
Returns the value of theoffset
record component.radius()
Returns the value of theradius
record component.Returns the value of thesmallParticle
record component.sound()
Returns the value of thesound
record component.final String
toString()
Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.world.item.enchantment.effects.EnchantmentEntityEffect
onChangedBlock
Methods inherited from interface net.minecraft.world.item.enchantment.effects.EnchantmentLocationBasedEffect
onDeactivated
-
Field Details
-
attributeToUser
private final boolean attributeToUserThe field for theattributeToUser
record component. -
damageType
The field for thedamageType
record component. -
knockbackMultiplier
The field for theknockbackMultiplier
record component. -
immuneBlocks
The field for theimmuneBlocks
record component. -
offset
The field for theoffset
record component. -
radius
The field for theradius
record component. -
createFire
private final boolean createFireThe field for thecreateFire
record component. -
blockInteraction
The field for theblockInteraction
record component. -
smallParticle
The field for thesmallParticle
record component. -
largeParticle
The field for thelargeParticle
record component. -
sound
The field for thesound
record 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 aExplodeEffect
record class.- Parameters:
attributeToUser
- the value for theattributeToUser
record componentdamageType
- the value for thedamageType
record componentknockbackMultiplier
- the value for theknockbackMultiplier
record componentimmuneBlocks
- the value for theimmuneBlocks
record componentoffset
- the value for theoffset
record componentradius
- the value for theradius
record componentcreateFire
- the value for thecreateFire
record componentblockInteraction
- the value for theblockInteraction
record componentsmallParticle
- the value for thesmallParticle
record componentlargeParticle
- the value for thelargeParticle
record componentsound
- the value for thesound
record component
-
-
Method Details
-
apply
public void apply(ServerLevel p_343276_, int p_344767_, EnchantedItemInUse p_342948_, Entity p_344263_, Vec3 p_343582_) - Specified by:
apply
in interfaceEnchantmentEntityEffect
-
getDamageSource
-
codec
- Specified by:
codec
in interfaceEnchantmentEntityEffect
- Specified by:
codec
in 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 theattributeToUser
record component.- Returns:
- the value of the
attributeToUser
record component
-
damageType
Returns the value of thedamageType
record component.- Returns:
- the value of the
damageType
record component
-
knockbackMultiplier
Returns the value of theknockbackMultiplier
record component.- Returns:
- the value of the
knockbackMultiplier
record component
-
immuneBlocks
Returns the value of theimmuneBlocks
record component.- Returns:
- the value of the
immuneBlocks
record component
-
offset
Returns the value of theoffset
record component.- Returns:
- the value of the
offset
record component
-
radius
Returns the value of theradius
record component.- Returns:
- the value of the
radius
record component
-
createFire
public boolean createFire()Returns the value of thecreateFire
record component.- Returns:
- the value of the
createFire
record component
-
blockInteraction
Returns the value of theblockInteraction
record component.- Returns:
- the value of the
blockInteraction
record component
-
smallParticle
Returns the value of thesmallParticle
record component.- Returns:
- the value of the
smallParticle
record component
-
largeParticle
Returns the value of thelargeParticle
record component.- Returns:
- the value of the
largeParticle
record component
-
sound
Returns the value of thesound
record component.- Returns:
- the value of the
sound
record component
-