Package net.minecraft.component.type
Record Class EquippableComponent
java.lang.Object
java.lang.Record
net.minecraft.component.type.EquippableComponent
- Record Components:
slot
-equipSound
-model
-cameraOverlay
-allowedEntities
-dispensable
-swappable
-damageOnHurt
-
public record EquippableComponent(EquipmentSlot slot, RegistryEntry<SoundEvent> equipSound, Optional<Identifier> model, Optional<Identifier> cameraOverlay, Optional<RegistryEntryList<EntityType<?>>> allowedEntities, boolean dispensable, boolean swappable, boolean damageOnHurt)
extends Record
- Mappings:
Namespace Name named net/minecraft/component/type/EquippableComponent
intermediary net/minecraft/class_10192
official dft
named slot
intermediary comp_3174
official c
named equipSound
intermediary comp_3175
official d
named model
intermediary comp_3176
official e
named cameraOverlay
intermediary comp_3306
official f
named allowedEntities
intermediary comp_3177
official g
named dispensable
intermediary comp_3178
official h
named swappable
intermediary comp_3213
official i
named damageOnHurt
intermediary comp_3214
official j
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Optional
<RegistryEntryList<EntityType<?>>> The field for theallowedEntities
record component.private final Optional
<Identifier> The field for thecameraOverlay
record component.static final com.mojang.serialization.Codec
<EquippableComponent> private final boolean
The field for thedamageOnHurt
record component.private final boolean
The field for thedispensable
record component.private final RegistryEntry
<SoundEvent> The field for theequipSound
record component.private final Optional
<Identifier> The field for themodel
record component.static final PacketCodec
<RegistryByteBuf, EquippableComponent> private final EquipmentSlot
The field for theslot
record component.private final boolean
The field for theswappable
record component. -
Constructor Summary
ConstructorDescriptionEquippableComponent
(EquipmentSlot equipmentSlot, RegistryEntry<SoundEvent> registryEntry, Optional<Identifier> optional, Optional<Identifier> optional2, Optional<RegistryEntryList<EntityType<?>>> optional3, boolean bool, boolean bool2, boolean bool3) -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theallowedEntities
record component.boolean
allows
(EntityType<?> entityType) static EquippableComponent.Builder
builder
(EquipmentSlot slot) Returns the value of thecameraOverlay
record component.boolean
Returns the value of thedamageOnHurt
record component.boolean
Returns the value of thedispensable
record component.final boolean
Indicates whether some other object is "equal to" this one.equip
(ItemStack stack, PlayerEntity player) Returns the value of theequipSound
record component.final int
hashCode()
Returns a hash code value for this object.model()
Returns the value of themodel
record component.static EquippableComponent
slot()
Returns the value of theslot
record component.boolean
Returns the value of theswappable
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
slot
The field for theslot
record component. -
equipSound
The field for theequipSound
record component. -
model
The field for themodel
record component. -
cameraOverlay
The field for thecameraOverlay
record component. -
allowedEntities
The field for theallowedEntities
record component. -
dispensable
private final boolean dispensableThe field for thedispensable
record component. -
swappable
private final boolean swappableThe field for theswappable
record component. -
damageOnHurt
private final boolean damageOnHurtThe field for thedamageOnHurt
record component. -
CODEC
- Mappings:
Namespace Name Mixin selector named CODEC
Lnet/minecraft/component/type/EquippableComponent;CODEC:Lcom/mojang/serialization/Codec;
intermediary field_54145
Lnet/minecraft/class_10192;field_54145:Lcom/mojang/serialization/Codec;
official a
Ldft;a:Lcom/mojang/serialization/Codec;
-
PACKET_CODEC
- Mappings:
Namespace Name Mixin selector named PACKET_CODEC
Lnet/minecraft/component/type/EquippableComponent;PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;
intermediary field_54146
Lnet/minecraft/class_10192;field_54146:Lnet/minecraft/class_9139;
official b
Ldft;b:Lzt;
-
-
Constructor Details
-
EquippableComponent
public EquippableComponent(EquipmentSlot equipmentSlot, RegistryEntry<SoundEvent> registryEntry, Optional<Identifier> optional, Optional<Identifier> optional2, Optional<RegistryEntryList<EntityType<?>>> optional3, boolean bool, boolean bool2, boolean bool3)
-
-
Method Details
-
ofCarpet
- Mappings:
Namespace Name Mixin selector named ofCarpet
Lnet/minecraft/component/type/EquippableComponent;ofCarpet(Lnet/minecraft/util/DyeColor;)Lnet/minecraft/component/type/EquippableComponent;
intermediary method_64017
Lnet/minecraft/class_10192;method_64017(Lnet/minecraft/class_1767;)Lnet/minecraft/class_10192;
official a
Ldft;a(Lcwl;)Ldft;
-
builder
- Mappings:
Namespace Name Mixin selector named builder
Lnet/minecraft/component/type/EquippableComponent;builder(Lnet/minecraft/entity/EquipmentSlot;)Lnet/minecraft/component/type/EquippableComponent$Builder;
intermediary method_64202
Lnet/minecraft/class_10192;method_64202(Lnet/minecraft/class_1304;)Lnet/minecraft/class_10192$class_10217;
official a
Ldft;a(Lbvr;)Ldft$a;
-
equip
- Mappings:
Namespace Name Mixin selector named equip
Lnet/minecraft/component/type/EquippableComponent;equip(Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/player/PlayerEntity;)Lnet/minecraft/util/ActionResult;
intermediary method_64018
Lnet/minecraft/class_10192;method_64018(Lnet/minecraft/class_1799;Lnet/minecraft/class_1657;)Lnet/minecraft/class_1269;
official a
Ldft;a(Lcxo;Lcpw;)Lbti;
-
allows
- Mappings:
Namespace Name Mixin selector named allows
Lnet/minecraft/component/type/EquippableComponent;allows(Lnet/minecraft/entity/EntityType;)Z
intermediary method_64015
Lnet/minecraft/class_10192;method_64015(Lnet/minecraft/class_1299;)Z
official a
Ldft;a(Lbvq;)Z
-
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 '=='. -
slot
Returns the value of theslot
record component.- Returns:
- the value of the
slot
record component
-
equipSound
Returns the value of theequipSound
record component.- Returns:
- the value of the
equipSound
record component
-
model
Returns the value of themodel
record component.- Returns:
- the value of the
model
record component
-
cameraOverlay
Returns the value of thecameraOverlay
record component.- Returns:
- the value of the
cameraOverlay
record component
-
allowedEntities
Returns the value of theallowedEntities
record component.- Returns:
- the value of the
allowedEntities
record component
-
dispensable
public boolean dispensable()Returns the value of thedispensable
record component.- Returns:
- the value of the
dispensable
record component
-
swappable
public boolean swappable()Returns the value of theswappable
record component.- Returns:
- the value of the
swappable
record component
-
damageOnHurt
public boolean damageOnHurt()Returns the value of thedamageOnHurt
record component.- Returns:
- the value of the
damageOnHurt
record component
-