Record Class UseCooldownComponent

java.lang.Object
java.lang.Record
net.minecraft.component.type.UseCooldownComponent
Record Components:
seconds -
cooldownGroup -

public record UseCooldownComponent(float seconds, Optional<Identifier> cooldownGroup) extends Record
Mappings:
Namespace Name
named net/minecraft/component/type/UseCooldownComponent
intermediary net/minecraft/class_10130
official dat
named seconds
intermediary comp_3091
official c
named cooldownGroup
intermediary comp_3092
official d
  • Field Details

    • seconds

      private final float seconds
      The field for the seconds record component.
    • cooldownGroup

      private final Optional<Identifier> cooldownGroup
      The field for the cooldownGroup record component.
    • CODEC

      public static final com.mojang.serialization.Codec<UseCooldownComponent> CODEC
      Mappings:
      Namespace Name Mixin selector
      named CODEC Lnet/minecraft/component/type/UseCooldownComponent;CODEC:Lcom/mojang/serialization/Codec;
      intermediary field_53799 Lnet/minecraft/class_10130;field_53799:Lcom/mojang/serialization/Codec;
      official a Ldat;a:Lcom/mojang/serialization/Codec;
    • PACKET_CODEC

      public static final PacketCodec<RegistryByteBuf,UseCooldownComponent> PACKET_CODEC
      Mappings:
      Namespace Name Mixin selector
      named PACKET_CODEC Lnet/minecraft/component/type/UseCooldownComponent;PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;
      intermediary field_53800 Lnet/minecraft/class_10130;field_53800:Lnet/minecraft/class_9139;
      official b Ldat;b:Lzt;
  • Constructor Details

    • UseCooldownComponent

      public UseCooldownComponent(float seconds)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/component/type/UseCooldownComponent;<init>(F)V
      intermediary <init> Lnet/minecraft/class_10130;<init>(F)V
      official <init> Ldat;<init>(F)V
    • UseCooldownComponent

      public UseCooldownComponent(float float2, Optional<Identifier> optional)
  • Method Details

    • getCooldownTicks

      public int getCooldownTicks()
      Mappings:
      Namespace Name Mixin selector
      named getCooldownTicks Lnet/minecraft/component/type/UseCooldownComponent;getCooldownTicks()I
      intermediary method_62860 Lnet/minecraft/class_10130;method_62860()I
      official a Ldat;a()I
    • set

      public void set(ItemStack stack, LivingEntity user)
      Mappings:
      Namespace Name Mixin selector
      named set Lnet/minecraft/component/type/UseCooldownComponent;set(Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/LivingEntity;)V
      intermediary method_62862 Lnet/minecraft/class_10130;method_62862(Lnet/minecraft/class_1799;Lnet/minecraft/class_1309;)V
      official a Ldat;a(Lcxo;Lbwf;)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.
    • seconds

      public float seconds()
      Returns the value of the seconds record component.
      Returns:
      the value of the seconds record component
    • cooldownGroup

      public Optional<Identifier> cooldownGroup()
      Returns the value of the cooldownGroup record component.
      Returns:
      the value of the cooldownGroup record component