Record Class PiercingWeapon
java.lang.Object
java.lang.Record
net.minestom.server.item.component.PiercingWeapon
public record PiercingWeapon(boolean dealsKnockback, boolean dismounts, @Nullable SoundEvent sound, @Nullable SoundEvent hitSound)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<PiercingWeapon> static final NetworkBuffer.Type<PiercingWeapon> -
Constructor Summary
ConstructorsConstructorDescriptionPiercingWeapon(boolean dealsKnockback, boolean dismounts, @Nullable SoundEvent sound, @Nullable SoundEvent hitSound) Creates an instance of aPiercingWeaponrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thedealsKnockbackrecord component.booleanReturns the value of thedismountsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.hitSound()Returns the value of thehitSoundrecord component.sound()Returns the value of thesoundrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
NETWORK_TYPE
-
CODEC
-
-
Constructor Details
-
PiercingWeapon
public PiercingWeapon(boolean dealsKnockback, boolean dismounts, @Nullable @Nullable SoundEvent sound, @Nullable @Nullable SoundEvent hitSound) Creates an instance of aPiercingWeaponrecord class.- Parameters:
dealsKnockback- the value for thedealsKnockbackrecord componentdismounts- the value for thedismountsrecord componentsound- the value for thesoundrecord componenthitSound- the value for thehitSoundrecord 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. -
dealsKnockback
public boolean dealsKnockback()Returns the value of thedealsKnockbackrecord component.- Returns:
- the value of the
dealsKnockbackrecord component
-
dismounts
public boolean dismounts()Returns the value of thedismountsrecord component.- Returns:
- the value of the
dismountsrecord component
-
sound
Returns the value of thesoundrecord component.- Returns:
- the value of the
soundrecord component
-
hitSound
Returns the value of thehitSoundrecord component.- Returns:
- the value of the
hitSoundrecord component
-