Package net.minecraft.world.effect
Record Class MobEffectInstance.Details
java.lang.Object
java.lang.Record
net.minecraft.world.effect.MobEffectInstance.Details
- Enclosing class:
MobEffectInstance
static record MobEffectInstance.Details(int amplifier, int duration, boolean ambient, boolean showParticles, boolean showIcon, Optional<MobEffectInstance.Details> hiddenEffect)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanThe field for theambientrecord component.private final intThe field for theamplifierrecord component.private final intThe field for thedurationrecord component.private final Optional<MobEffectInstance.Details> The field for thehiddenEffectrecord component.static final com.mojang.serialization.MapCodec<MobEffectInstance.Details> private final booleanThe field for theshowIconrecord component.private final booleanThe field for theshowParticlesrecord component.static final StreamCodec<io.netty.buffer.ByteBuf, MobEffectInstance.Details> -
Constructor Summary
ConstructorsConstructorDescriptionDetails(int amplifier, int duration, boolean ambient, boolean showParticles, boolean showIcon, Optional<MobEffectInstance.Details> hiddenEffect) Creates an instance of aDetailsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanambient()Returns the value of theambientrecord component.intReturns the value of theamplifierrecord component.private static MobEffectInstance.Detailscreate(int p_334251_, int p_332882_, boolean p_330487_, boolean p_334607_, Optional<Boolean> p_329280_, Optional<MobEffectInstance.Details> p_330477_) intduration()Returns the value of thedurationrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thehiddenEffectrecord component.booleanshowIcon()Returns the value of theshowIconrecord component.booleanReturns the value of theshowParticlesrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
amplifier
private final int amplifierThe field for theamplifierrecord component. -
duration
private final int durationThe field for thedurationrecord component. -
ambient
private final boolean ambientThe field for theambientrecord component. -
showParticles
private final boolean showParticlesThe field for theshowParticlesrecord component. -
showIcon
private final boolean showIconThe field for theshowIconrecord component. -
MAP_CODEC
-
STREAM_CODEC
-
-
Constructor Details
-
Details
Details(int amplifier, int duration, boolean ambient, boolean showParticles, boolean showIcon, Optional<MobEffectInstance.Details> hiddenEffect) Creates an instance of aDetailsrecord class.- Parameters:
amplifier- the value for theamplifierrecord componentduration- the value for thedurationrecord componentambient- the value for theambientrecord componentshowParticles- the value for theshowParticlesrecord componentshowIcon- the value for theshowIconrecord componenthiddenEffect- the value for thehiddenEffectrecord component
-
-
Method Details
-
create
private static MobEffectInstance.Details create(int p_334251_, int p_332882_, boolean p_330487_, boolean p_334607_, Optional<Boolean> p_329280_, Optional<MobEffectInstance.Details> p_330477_) -
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 '=='. -
amplifier
public int amplifier()Returns the value of theamplifierrecord component.- Returns:
- the value of the
amplifierrecord component
-
duration
public int duration()Returns the value of thedurationrecord component.- Returns:
- the value of the
durationrecord component
-
ambient
public boolean ambient()Returns the value of theambientrecord component.- Returns:
- the value of the
ambientrecord component
-
showParticles
public boolean showParticles()Returns the value of theshowParticlesrecord component.- Returns:
- the value of the
showParticlesrecord component
-
showIcon
public boolean showIcon()Returns the value of theshowIconrecord component.- Returns:
- the value of the
showIconrecord component
-