Package net.minecraft.component.type
Record Class PiercingWeaponComponent
java.lang.Object
java.lang.Record
net.minecraft.component.type.PiercingWeaponComponent
- Record Components:
minReach-maxReach-hitboxMargin-dealsKnockback-dismounts-sound-hitSound-
public record PiercingWeaponComponent(float minReach, float maxReach, float hitboxMargin, 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 dnhnamed minReachintermediary comp_4968official cnamed maxReachintermediary comp_4969official dnamed hitboxMarginintermediary comp_4970official enamed dealsKnockbackintermediary comp_4971official fnamed dismountsintermediary comp_4972official gnamed soundintermediary comp_4973official hnamed hitSoundintermediary comp_4974official i
-
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 floatThe field for thehitboxMarginrecord component.private final Optional<RegistryEntry<SoundEvent>> The field for thehitSoundrecord component.private final floatThe field for themaxReachrecord component.private final floatThe field for theminReachrecord component.static final PacketCodec<RegistryByteBuf, PiercingWeaponComponent> private final Optional<RegistryEntry<SoundEvent>> The field for thesoundrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionPiercingWeaponComponent(float minReach, float maxReach, float hitboxMargin, 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.floatReturns the value of thehitboxMarginrecord component.hitSound()Returns the value of thehitSoundrecord component.floatmaxReach()Returns the value of themaxReachrecord component.floatminReach()Returns the value of theminReachrecord component.voidplayHitSound(Entity entity) voidsound()Returns the value of thesoundrecord component.voidstab(LivingEntity livingEntity, EquipmentSlot slot) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
minReach
private final float minReachThe field for theminReachrecord component. -
maxReach
private final float maxReachThe field for themaxReachrecord component. -
hitboxMargin
private final float hitboxMarginThe field for thehitboxMarginrecord component. -
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 aLdnh;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 bLdnh;b:Laat;
-
-
Constructor Details
-
PiercingWeaponComponent
public PiercingWeaponComponent(float minReach, float maxReach, float hitboxMargin, boolean dealsKnockback, boolean dismounts, Optional<RegistryEntry<SoundEvent>> sound, Optional<RegistryEntry<SoundEvent>> hitSound) Creates an instance of aPiercingWeaponComponentrecord class.- Parameters:
minReach- the value for theminReachrecord componentmaxReach- the value for themaxReachrecord componenthitboxMargin- the value for thehitboxMarginrecord componentdealsKnockback- 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 aLdnh;a(Lcgd;)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 bLdnh;b(Lcgd;)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 aLdnh;a(Lcgd;Lcgd;)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 aLdnh;a(Lche;Lcgn;)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 '=='. -
minReach
public float minReach()Returns the value of theminReachrecord component.- Returns:
- the value of the
minReachrecord component
-
maxReach
public float maxReach()Returns the value of themaxReachrecord component.- Returns:
- the value of the
maxReachrecord component
-
hitboxMargin
public float hitboxMargin()Returns the value of thehitboxMarginrecord component.- Returns:
- the value of the
hitboxMarginrecord component
-
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
-