Package net.minecraft.component.type
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
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static interface
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<ConsumableComponent> private final float
The field for theconsumeSeconds
record component.static final float
private final boolean
The field for thehasConsumeParticles
record component.private final List
<ConsumeEffect> The field for theonConsumeEffects
record component.static final PacketCodec
<RegistryByteBuf, ConsumableComponent> private static final int
private static final float
private final RegistryEntry
<SoundEvent> The field for thesound
record component.private final UseAction
The field for theuseAction
record component. -
Constructor Summary
ConstructorDescriptionConsumableComponent
(float float2, UseAction useAction, RegistryEntry<SoundEvent> registryEntry, boolean bool, List<ConsumeEffect> list) -
Method Summary
Modifier and TypeMethodDescriptionstatic ConsumableComponent.Builder
builder()
boolean
canConsume
(LivingEntity user, ItemStack stack) consume
(LivingEntity user, ItemStack stack, Hand hand) float
Returns the value of theconsumeSeconds
record component.final boolean
Indicates whether some other object is "equal to" this one.finishConsumption
(World world, LivingEntity user, ItemStack stack) int
boolean
Returns the value of thehasConsumeParticles
record component.final int
hashCode()
Returns a hash code value for this object.Returns the value of theonConsumeEffects
record component.boolean
shouldSpawnParticlesAndPlaySounds
(int remainingUseTicks) sound()
Returns the value of thesound
record component.void
spawnParticlesAndPlaySound
(Random random, LivingEntity user, ItemStack stack, int particleCount) final String
toString()
Returns a string representation of this record class.Returns the value of theuseAction
record component.
-
Field Details
-
consumeSeconds
private final float consumeSecondsThe field for theconsumeSeconds
record component. -
useAction
The field for theuseAction
record component. -
sound
The field for thesound
record component. -
hasConsumeParticles
private final boolean hasConsumeParticlesThe field for thehasConsumeParticles
record component. -
onConsumeEffects
The field for theonConsumeEffects
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
- 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
- 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
-
ConsumableComponent
public ConsumableComponent(float float2, UseAction useAction, RegistryEntry<SoundEvent> registryEntry, boolean bool, List<ConsumeEffect> list)
-
-
Method Details
-
consume
- 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
- 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
- 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
- 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
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 '=='. -
consumeSeconds
public float consumeSeconds()Returns the value of theconsumeSeconds
record component.- Returns:
- the value of the
consumeSeconds
record component
-
useAction
Returns the value of theuseAction
record component.- Returns:
- the value of the
useAction
record component
-
sound
Returns the value of thesound
record component.- Returns:
- the value of the
sound
record component
-
hasConsumeParticles
public boolean hasConsumeParticles()Returns the value of thehasConsumeParticles
record component.- Returns:
- the value of the
hasConsumeParticles
record component
-
onConsumeEffects
Returns the value of theonConsumeEffects
record component.- Returns:
- the value of the
onConsumeEffects
record component
-