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/PiercingWeaponComponent
intermediary net/minecraft/class_12125
official dnh
named minReach
intermediary comp_4968
official c
named maxReach
intermediary comp_4969
official d
named hitboxMargin
intermediary comp_4970
official e
named dealsKnockback
intermediary comp_4971
official f
named dismounts
intermediary comp_4972
official g
named sound
intermediary comp_4973
official h
named hitSound
intermediary comp_4974
official i
  • Field Details

    • minReach

      private final float minReach
      The field for the minReach record component.
    • maxReach

      private final float maxReach
      The field for the maxReach record component.
    • hitboxMargin

      private final float hitboxMargin
      The field for the hitboxMargin record component.
    • dealsKnockback

      private final boolean dealsKnockback
      The field for the dealsKnockback record component.
    • dismounts

      private final boolean dismounts
      The field for the dismounts record component.
    • sound

      private final Optional<RegistryEntry<SoundEvent>> sound
      The field for the sound record component.
    • hitSound

      private final Optional<RegistryEntry<SoundEvent>> hitSound
      The field for the hitSound record component.
    • CODEC

      public static final com.mojang.serialization.Codec<PiercingWeaponComponent> CODEC
      Mappings:
      Namespace Name Mixin selector
      named CODEC Lnet/minecraft/component/type/PiercingWeaponComponent;CODEC:Lcom/mojang/serialization/Codec;
      intermediary field_63411 Lnet/minecraft/class_12125;field_63411:Lcom/mojang/serialization/Codec;
      official a Ldnh;a:Lcom/mojang/serialization/Codec;
    • PACKET_CODEC

      public static final PacketCodec<RegistryByteBuf,PiercingWeaponComponent> PACKET_CODEC
      Mappings:
      Namespace Name Mixin selector
      named PACKET_CODEC Lnet/minecraft/component/type/PiercingWeaponComponent;PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;
      intermediary field_63412 Lnet/minecraft/class_12125;field_63412:Lnet/minecraft/class_9139;
      official b Ldnh;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 a PiercingWeaponComponent record class.
      Parameters:
      minReach - the value for the minReach record component
      maxReach - the value for the maxReach record component
      hitboxMargin - the value for the hitboxMargin record component
      dealsKnockback - the value for the dealsKnockback record component
      dismounts - the value for the dismounts record component
      sound - the value for the sound record component
      hitSound - the value for the hitSound record component
  • Method Details

    • playSound

      public void playSound(Entity entity)
      Mappings:
      Namespace Name Mixin selector
      named playSound Lnet/minecraft/component/type/PiercingWeaponComponent;playSound(Lnet/minecraft/entity/Entity;)V
      intermediary method_75243 Lnet/minecraft/class_12125;method_75243(Lnet/minecraft/class_1297;)V
      official a Ldnh;a(Lcgd;)V
    • playHitSound

      public void playHitSound(Entity entity)
      Mappings:
      Namespace Name Mixin selector
      named playHitSound Lnet/minecraft/component/type/PiercingWeaponComponent;playHitSound(Lnet/minecraft/entity/Entity;)V
      intermediary method_75247 Lnet/minecraft/class_12125;method_75247(Lnet/minecraft/class_1297;)V
      official b Ldnh;b(Lcgd;)V
    • canHit

      public static boolean canHit(Entity attacker, Entity target)
      Mappings:
      Namespace Name Mixin selector
      named canHit Lnet/minecraft/component/type/PiercingWeaponComponent;canHit(Lnet/minecraft/entity/Entity;Lnet/minecraft/entity/Entity;)Z
      intermediary method_75244 Lnet/minecraft/class_12125;method_75244(Lnet/minecraft/class_1297;Lnet/minecraft/class_1297;)Z
      official a Ldnh;a(Lcgd;Lcgd;)Z
    • stab

      public void stab(LivingEntity livingEntity, EquipmentSlot slot)
      Mappings:
      Namespace Name Mixin selector
      named stab Lnet/minecraft/component/type/PiercingWeaponComponent;stab(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/EquipmentSlot;)V
      intermediary method_75242 Lnet/minecraft/class_12125;method_75242(Lnet/minecraft/class_1309;Lnet/minecraft/class_1304;)V
      official a Ldnh;a(Lche;Lcgn;)V
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object object)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      object - the object with which to compare
      Returns:
      true if this object is the same as the object argument; false otherwise.
    • minReach

      public float minReach()
      Returns the value of the minReach record component.
      Returns:
      the value of the minReach record component
    • maxReach

      public float maxReach()
      Returns the value of the maxReach record component.
      Returns:
      the value of the maxReach record component
    • hitboxMargin

      public float hitboxMargin()
      Returns the value of the hitboxMargin record component.
      Returns:
      the value of the hitboxMargin record component
    • dealsKnockback

      public boolean dealsKnockback()
      Returns the value of the dealsKnockback record component.
      Returns:
      the value of the dealsKnockback record component
    • dismounts

      public boolean dismounts()
      Returns the value of the dismounts record component.
      Returns:
      the value of the dismounts record component
    • sound

      public Optional<RegistryEntry<SoundEvent>> sound()
      Returns the value of the sound record component.
      Returns:
      the value of the sound record component
    • hitSound

      public Optional<RegistryEntry<SoundEvent>> hitSound()
      Returns the value of the hitSound record component.
      Returns:
      the value of the hitSound record component