Record Class SulfurCubeArchetype.ContactDamage
java.lang.Object
java.lang.Record
net.minecraft.world.entity.SulfurCubeArchetype.ContactDamage
- Enclosing class:
SulfurCubeArchetype
public static record SulfurCubeArchetype.ContactDamage(Holder<DamageType> damageType, FloatProvider amount, boolean attributeToSource)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final FloatProviderThe field for theamountrecord component.private final booleanThe field for theattributeToSourcerecord component.static final com.mojang.serialization.Codec<SulfurCubeArchetype.ContactDamage> private final Holder<DamageType> The field for thedamageTyperecord component. -
Constructor Summary
ConstructorsConstructorDescriptionContactDamage(Holder<DamageType> damageType, FloatProvider amount, boolean attributeToSource) Creates an instance of aContactDamagerecord class. -
Method Summary
Modifier and TypeMethodDescriptionamount()Returns the value of theamountrecord component.booleanReturns the value of theattributeToSourcerecord component.Returns the value of thedamageTyperecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
damageType
The field for thedamageTyperecord component. -
amount
The field for theamountrecord component. -
attributeToSource
private final boolean attributeToSourceThe field for theattributeToSourcerecord component. -
CODEC
-
-
Constructor Details
-
ContactDamage
public ContactDamage(Holder<DamageType> damageType, FloatProvider amount, boolean attributeToSource) Creates an instance of aContactDamagerecord class.- Parameters:
damageType- the value for thedamageTyperecord componentamount- the value for theamountrecord componentattributeToSource- the value for theattributeToSourcerecord component
-
-
Method Details
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
damageType
Returns the value of thedamageTyperecord component.- Returns:
- the value of the
damageTyperecord component
-
amount
Returns the value of theamountrecord component.- Returns:
- the value of the
amountrecord component
-
attributeToSource
public boolean attributeToSource()Returns the value of theattributeToSourcerecord component.- Returns:
- the value of the
attributeToSourcerecord component
-