Package net.minecraft.component.type
Record Class PiercingWeaponComponent
java.lang.Object
java.lang.Record
net.minecraft.component.type.PiercingWeaponComponent
- Record Components:
dealsKnockback-dismounts-sound-hitSound-
public record PiercingWeaponComponent(boolean dealsKnockback, boolean dismounts, Optional<RegistryEntry<SoundEvent>> sound, Optional<RegistryEntry<SoundEvent>> hitSound)
extends Record
- Mappings:
Namespace Name named net/minecraft/component/type/PiercingWeaponComponentintermediary net/minecraft/class_12125official downamed dealsKnockbackintermediary comp_4971official cnamed dismountsintermediary comp_4972official dnamed soundintermediary comp_4973official enamed hitSoundintermediary comp_4974official f
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<PiercingWeaponComponent> private final booleanThe field for thedealsKnockbackrecord component.private final booleanThe field for thedismountsrecord component.private final Optional<RegistryEntry<SoundEvent>> The field for thehitSoundrecord component.static final PacketCodec<RegistryByteBuf, PiercingWeaponComponent> private final Optional<RegistryEntry<SoundEvent>> The field for thesoundrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionPiercingWeaponComponent(boolean dealsKnockback, boolean dismounts, Optional<RegistryEntry<SoundEvent>> sound, Optional<RegistryEntry<SoundEvent>> hitSound) Creates an instance of aPiercingWeaponComponentrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanbooleanReturns 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.voidplayHitSound(Entity entity) voidsound()Returns the value of thesoundrecord component.voidstab(LivingEntity attacker, EquipmentSlot slot) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
dealsKnockback
private final boolean dealsKnockbackThe field for thedealsKnockbackrecord component. -
dismounts
private final boolean dismountsThe field for thedismountsrecord component. -
sound
The field for thesoundrecord component. -
hitSound
The field for thehitSoundrecord component. -
CODEC
- Mappings:
Namespace Name Mixin selector named CODECLnet/minecraft/component/type/PiercingWeaponComponent;CODEC:Lcom/mojang/serialization/Codec;intermediary field_63411Lnet/minecraft/class_12125;field_63411:Lcom/mojang/serialization/Codec;official aLdow;a:Lcom/mojang/serialization/Codec;
-
PACKET_CODEC
- Mappings:
Namespace Name Mixin selector named PACKET_CODECLnet/minecraft/component/type/PiercingWeaponComponent;PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;intermediary field_63412Lnet/minecraft/class_12125;field_63412:Lnet/minecraft/class_9139;official bLdow;b:Laao;
-
-
Constructor Details
-
PiercingWeaponComponent
public PiercingWeaponComponent(boolean dealsKnockback, boolean dismounts, Optional<RegistryEntry<SoundEvent>> sound, Optional<RegistryEntry<SoundEvent>> hitSound) Creates an instance of aPiercingWeaponComponentrecord 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
-
playSound
- Mappings:
Namespace Name Mixin selector named playSoundLnet/minecraft/component/type/PiercingWeaponComponent;playSound(Lnet/minecraft/entity/Entity;)Vintermediary method_75243Lnet/minecraft/class_12125;method_75243(Lnet/minecraft/class_1297;)Vofficial aLdow;a(Lcgk;)V
-
playHitSound
- Mappings:
Namespace Name Mixin selector named playHitSoundLnet/minecraft/component/type/PiercingWeaponComponent;playHitSound(Lnet/minecraft/entity/Entity;)Vintermediary method_75247Lnet/minecraft/class_12125;method_75247(Lnet/minecraft/class_1297;)Vofficial bLdow;b(Lcgk;)V
-
canHit
- Mappings:
Namespace Name Mixin selector named canHitLnet/minecraft/component/type/PiercingWeaponComponent;canHit(Lnet/minecraft/entity/Entity;Lnet/minecraft/entity/Entity;)Zintermediary method_75244Lnet/minecraft/class_12125;method_75244(Lnet/minecraft/class_1297;Lnet/minecraft/class_1297;)Zofficial aLdow;a(Lcgk;Lcgk;)Z
-
stab
- Mappings:
Namespace Name Mixin selector named stabLnet/minecraft/component/type/PiercingWeaponComponent;stab(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/EquipmentSlot;)Vintermediary method_75242Lnet/minecraft/class_12125;method_75242(Lnet/minecraft/class_1309;Lnet/minecraft/class_1304;)Vofficial aLdow;a(Lchl;Lcgv;)V
-
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 '=='. -
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
-