Record Class ConsumableComponent

java.lang.Object
java.lang.Record
net.minecraft.component.type.ConsumableComponent
Record Components:
consumeSeconds -
useAction -
sound -
hasConsumeParticles -
onConsumeEffects -

public record ConsumableComponent(float consumeSeconds, UseAction useAction, RegistryEntry<SoundEvent> sound, boolean hasConsumeParticles, List<ConsumeEffect> onConsumeEffects) extends Record
Mappings:
Namespace Name
named net/minecraft/component/type/ConsumableComponent
intermediary net/minecraft/class_10124
official czu
named consumeSeconds
intermediary comp_3085
official d
named useAction
intermediary comp_3086
official e
named sound
intermediary comp_3087
official f
named hasConsumeParticles
intermediary comp_3088
official g
named onConsumeEffects
intermediary comp_3089
official h
  • Field Details

    • consumeSeconds

      private final float consumeSeconds
      The field for the consumeSeconds record component.
    • useAction

      private final UseAction useAction
      The field for the useAction record component.
    • sound

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

      private final boolean hasConsumeParticles
      The field for the hasConsumeParticles record component.
    • onConsumeEffects

      private final List<ConsumeEffect> onConsumeEffects
      The field for the onConsumeEffects record component.
    • DEFAULT_CONSUME_SECONDS

      public static final float DEFAULT_CONSUME_SECONDS
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named DEFAULT_CONSUME_SECONDS Lnet/minecraft/component/type/ConsumableComponent;DEFAULT_CONSUME_SECONDS:F
      intermediary field_53769 Lnet/minecraft/class_10124;field_53769:F
      official a Lczu;a:F
    • PARTICLES_AND_SOUND_TICK_INTERVAL

      private static final int PARTICLES_AND_SOUND_TICK_INTERVAL
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named PARTICLES_AND_SOUND_TICK_INTERVAL Lnet/minecraft/component/type/ConsumableComponent;PARTICLES_AND_SOUND_TICK_INTERVAL:I
      intermediary field_53772 Lnet/minecraft/class_10124;field_53772:I
      official i Lczu;i:I
    • PARTICLES_AND_SOUND_TICK_THRESHOLD

      private static final float PARTICLES_AND_SOUND_TICK_THRESHOLD
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named PARTICLES_AND_SOUND_TICK_THRESHOLD Lnet/minecraft/component/type/ConsumableComponent;PARTICLES_AND_SOUND_TICK_THRESHOLD:F
      intermediary field_53773 Lnet/minecraft/class_10124;field_53773:F
      official j Lczu;j:F
    • CODEC

      public static final com.mojang.serialization.Codec<ConsumableComponent> CODEC
      Mappings:
      Namespace Name Mixin selector
      named CODEC Lnet/minecraft/component/type/ConsumableComponent;CODEC:Lcom/mojang/serialization/Codec;
      intermediary field_53770 Lnet/minecraft/class_10124;field_53770:Lcom/mojang/serialization/Codec;
      official b Lczu;b:Lcom/mojang/serialization/Codec;
    • PACKET_CODEC

      public static final PacketCodec<RegistryByteBuf,ConsumableComponent> PACKET_CODEC
      Mappings:
      Namespace Name Mixin selector
      named PACKET_CODEC Lnet/minecraft/component/type/ConsumableComponent;PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;
      intermediary field_53771 Lnet/minecraft/class_10124;field_53771:Lnet/minecraft/class_9139;
      official c Lczu;c:Lzt;
  • Constructor Details

  • Method Details

    • consume

      public ActionResult consume(LivingEntity user, ItemStack stack, Hand hand)
      Mappings:
      Namespace Name Mixin selector
      named consume Lnet/minecraft/component/type/ConsumableComponent;consume(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/item/ItemStack;Lnet/minecraft/util/Hand;)Lnet/minecraft/util/ActionResult;
      intermediary method_62845 Lnet/minecraft/class_10124;method_62845(Lnet/minecraft/class_1309;Lnet/minecraft/class_1799;Lnet/minecraft/class_1268;)Lnet/minecraft/class_1269;
      official a Lczu;a(Lbwf;Lcxo;Lbth;)Lbti;
    • finishConsumption

      public ItemStack finishConsumption(World world, LivingEntity user, ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      named finishConsumption Lnet/minecraft/component/type/ConsumableComponent;finishConsumption(Lnet/minecraft/world/World;Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/item/ItemStack;)Lnet/minecraft/item/ItemStack;
      intermediary method_62847 Lnet/minecraft/class_10124;method_62847(Lnet/minecraft/class_1937;Lnet/minecraft/class_1309;Lnet/minecraft/class_1799;)Lnet/minecraft/class_1799;
      official a Lczu;a(Ldhh;Lbwf;Lcxo;)Lcxo;
    • canConsume

      public boolean canConsume(LivingEntity user, ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      named canConsume Lnet/minecraft/component/type/ConsumableComponent;canConsume(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/item/ItemStack;)Z
      intermediary method_62844 Lnet/minecraft/class_10124;method_62844(Lnet/minecraft/class_1309;Lnet/minecraft/class_1799;)Z
      official a Lczu;a(Lbwf;Lcxo;)Z
    • getConsumeTicks

      public int getConsumeTicks()
      Mappings:
      Namespace Name Mixin selector
      named getConsumeTicks Lnet/minecraft/component/type/ConsumableComponent;getConsumeTicks()I
      intermediary method_62841 Lnet/minecraft/class_10124;method_62841()I
      official a Lczu;a()I
    • spawnParticlesAndPlaySound

      public void spawnParticlesAndPlaySound(Random random, LivingEntity user, ItemStack stack, int particleCount)
      Mappings:
      Namespace Name Mixin selector
      named spawnParticlesAndPlaySound Lnet/minecraft/component/type/ConsumableComponent;spawnParticlesAndPlaySound(Lnet/minecraft/util/math/random/Random;Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/item/ItemStack;I)V
      intermediary method_62843 Lnet/minecraft/class_10124;method_62843(Lnet/minecraft/class_5819;Lnet/minecraft/class_1309;Lnet/minecraft/class_1799;I)V
      official a Lczu;a(Lbam;Lbwf;Lcxo;I)V
    • shouldSpawnParticlesAndPlaySounds

      public boolean shouldSpawnParticlesAndPlaySounds(int remainingUseTicks)
      Mappings:
      Namespace Name Mixin selector
      named shouldSpawnParticlesAndPlaySounds Lnet/minecraft/component/type/ConsumableComponent;shouldSpawnParticlesAndPlaySounds(I)Z
      intermediary method_62842 Lnet/minecraft/class_10124;method_62842(I)Z
      official a Lczu;a(I)Z
    • builder

      public static ConsumableComponent.Builder builder()
      Mappings:
      Namespace Name Mixin selector
      named builder Lnet/minecraft/component/type/ConsumableComponent;builder()Lnet/minecraft/component/type/ConsumableComponent$Builder;
      intermediary method_62850 Lnet/minecraft/class_10124;method_62850()Lnet/minecraft/class_10124$class_10125;
      official b Lczu;b()Lczu$a;
    • 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.
    • consumeSeconds

      public float consumeSeconds()
      Returns the value of the consumeSeconds record component.
      Returns:
      the value of the consumeSeconds record component
    • useAction

      public UseAction useAction()
      Returns the value of the useAction record component.
      Returns:
      the value of the useAction record component
    • sound

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

      public boolean hasConsumeParticles()
      Returns the value of the hasConsumeParticles record component.
      Returns:
      the value of the hasConsumeParticles record component
    • onConsumeEffects

      public List<ConsumeEffect> onConsumeEffects()
      Returns the value of the onConsumeEffects record component.
      Returns:
      the value of the onConsumeEffects record component