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/ConsumableComponentintermediary net/minecraft/class_10124official dcpnamed consumeSecondsintermediary comp_3085official dnamed useActionintermediary comp_3086official enamed soundintermediary comp_3087official fnamed hasConsumeParticlesintermediary comp_3088official gnamed onConsumeEffectsintermediary comp_3089official h
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic interface -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ConsumableComponent> private final floatThe field for theconsumeSecondsrecord component.static final floatprivate final booleanThe field for thehasConsumeParticlesrecord component.private final List<ConsumeEffect> The field for theonConsumeEffectsrecord component.static final PacketCodec<RegistryByteBuf, ConsumableComponent> private static final intprivate static final floatprivate final RegistryEntry<SoundEvent> The field for thesoundrecord component.private final UseActionThe field for theuseActionrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionConsumableComponent(float float2, UseAction useAction, RegistryEntry<SoundEvent> registryEntry, boolean bool, List<ConsumeEffect> list) -
Method Summary
Modifier and TypeMethodDescriptionstatic ConsumableComponent.Builderbuilder()booleancanConsume(LivingEntity user, ItemStack stack) consume(LivingEntity user, ItemStack stack, Hand hand) floatReturns the value of theconsumeSecondsrecord component.final booleanIndicates whether some other object is "equal to" this one.finishConsumption(World world, LivingEntity user, ItemStack stack) intbooleanReturns the value of thehasConsumeParticlesrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theonConsumeEffectsrecord component.booleanshouldSpawnParticlesAndPlaySounds(int remainingUseTicks) sound()Returns the value of thesoundrecord component.voidspawnParticlesAndPlaySound(Random random, LivingEntity user, ItemStack stack, int particleCount) final StringtoString()Returns a string representation of this record class.Returns the value of theuseActionrecord component.
-
Field Details
-
consumeSeconds
private final float consumeSecondsThe field for theconsumeSecondsrecord component. -
useAction
The field for theuseActionrecord component. -
sound
The field for thesoundrecord component. -
hasConsumeParticles
private final boolean hasConsumeParticlesThe field for thehasConsumeParticlesrecord component. -
onConsumeEffects
The field for theonConsumeEffectsrecord component. -
DEFAULT_CONSUME_SECONDS
public static final float DEFAULT_CONSUME_SECONDS- See Also:
- Mappings:
Namespace Name Mixin selector named DEFAULT_CONSUME_SECONDSLnet/minecraft/component/type/ConsumableComponent;DEFAULT_CONSUME_SECONDS:Fintermediary field_53769Lnet/minecraft/class_10124;field_53769:Fofficial aLdcp;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_INTERVALLnet/minecraft/component/type/ConsumableComponent;PARTICLES_AND_SOUND_TICK_INTERVAL:Iintermediary field_53772Lnet/minecraft/class_10124;field_53772:Iofficial iLdcp;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_THRESHOLDLnet/minecraft/component/type/ConsumableComponent;PARTICLES_AND_SOUND_TICK_THRESHOLD:Fintermediary field_53773Lnet/minecraft/class_10124;field_53773:Fofficial jLdcp;j:F
-
CODEC
- Mappings:
Namespace Name Mixin selector named CODECLnet/minecraft/component/type/ConsumableComponent;CODEC:Lcom/mojang/serialization/Codec;intermediary field_53770Lnet/minecraft/class_10124;field_53770:Lcom/mojang/serialization/Codec;official bLdcp;b:Lcom/mojang/serialization/Codec;
-
PACKET_CODEC
- Mappings:
Namespace Name Mixin selector named PACKET_CODECLnet/minecraft/component/type/ConsumableComponent;PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;intermediary field_53771Lnet/minecraft/class_10124;field_53771:Lnet/minecraft/class_9139;official cLdcp;c:Lze;
-
-
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 consumeLnet/minecraft/component/type/ConsumableComponent;consume(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/item/ItemStack;Lnet/minecraft/util/Hand;)Lnet/minecraft/util/ActionResult;intermediary method_62845Lnet/minecraft/class_10124;method_62845(Lnet/minecraft/class_1309;Lnet/minecraft/class_1799;Lnet/minecraft/class_1268;)Lnet/minecraft/class_1269;official aLdcp;a(Lbyf;Ldak;Lbvb;)Lbvc;
-
finishConsumption
- Mappings:
Namespace Name Mixin selector named finishConsumptionLnet/minecraft/component/type/ConsumableComponent;finishConsumption(Lnet/minecraft/world/World;Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/item/ItemStack;)Lnet/minecraft/item/ItemStack;intermediary method_62847Lnet/minecraft/class_10124;method_62847(Lnet/minecraft/class_1937;Lnet/minecraft/class_1309;Lnet/minecraft/class_1799;)Lnet/minecraft/class_1799;official aLdcp;a(Ldkj;Lbyf;Ldak;)Ldak;
-
canConsume
- Mappings:
Namespace Name Mixin selector named canConsumeLnet/minecraft/component/type/ConsumableComponent;canConsume(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/item/ItemStack;)Zintermediary method_62844Lnet/minecraft/class_10124;method_62844(Lnet/minecraft/class_1309;Lnet/minecraft/class_1799;)Zofficial aLdcp;a(Lbyf;Ldak;)Z
-
getConsumeTicks
public int getConsumeTicks()- Mappings:
Namespace Name Mixin selector named getConsumeTicksLnet/minecraft/component/type/ConsumableComponent;getConsumeTicks()Iintermediary method_62841Lnet/minecraft/class_10124;method_62841()Iofficial aLdcp;a()I
-
spawnParticlesAndPlaySound
public void spawnParticlesAndPlaySound(Random random, LivingEntity user, ItemStack stack, int particleCount) - Mappings:
Namespace Name Mixin selector named spawnParticlesAndPlaySoundLnet/minecraft/component/type/ConsumableComponent;spawnParticlesAndPlaySound(Lnet/minecraft/util/math/random/Random;Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/item/ItemStack;I)Vintermediary method_62843Lnet/minecraft/class_10124;method_62843(Lnet/minecraft/class_5819;Lnet/minecraft/class_1309;Lnet/minecraft/class_1799;I)Vofficial aLdcp;a(Lbai;Lbyf;Ldak;I)V
-
shouldSpawnParticlesAndPlaySounds
public boolean shouldSpawnParticlesAndPlaySounds(int remainingUseTicks) - Mappings:
Namespace Name Mixin selector named shouldSpawnParticlesAndPlaySoundsLnet/minecraft/component/type/ConsumableComponent;shouldSpawnParticlesAndPlaySounds(I)Zintermediary method_62842Lnet/minecraft/class_10124;method_62842(I)Zofficial aLdcp;a(I)Z
-
builder
- Mappings:
Namespace Name Mixin selector named builderLnet/minecraft/component/type/ConsumableComponent;builder()Lnet/minecraft/component/type/ConsumableComponent$Builder;intermediary method_62850Lnet/minecraft/class_10124;method_62850()Lnet/minecraft/class_10124$class_10125;official bLdcp;b()Ldcp$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 theconsumeSecondsrecord component.- Returns:
- the value of the
consumeSecondsrecord component
-
useAction
Returns the value of theuseActionrecord component.- Returns:
- the value of the
useActionrecord component
-
sound
Returns the value of thesoundrecord component.- Returns:
- the value of the
soundrecord component
-
hasConsumeParticles
public boolean hasConsumeParticles()Returns the value of thehasConsumeParticlesrecord component.- Returns:
- the value of the
hasConsumeParticlesrecord component
-
onConsumeEffects
Returns the value of theonConsumeEffectsrecord component.- Returns:
- the value of the
onConsumeEffectsrecord component
-