Package net.minecraft.component.type
Record Class EquippableComponent
java.lang.Object
java.lang.Record
net.minecraft.component.type.EquippableComponent
- Record Components:
slot-equipSound-assetId-cameraOverlay-allowedEntities-dispensable-swappable-damageOnHurt-
public record EquippableComponent(EquipmentSlot slot, RegistryEntry<SoundEvent> equipSound, Optional<RegistryKey<EquipmentAsset>> assetId, Optional<Identifier> cameraOverlay, Optional<RegistryEntryList<EntityType<?>>> allowedEntities, boolean dispensable, boolean swappable, boolean damageOnHurt)
extends Record
- Mappings:
Namespace Name named net/minecraft/component/type/EquippableComponentintermediary net/minecraft/class_10192official devnamed slotintermediary comp_3174official cnamed equipSoundintermediary comp_3175official dnamed assetIdintermediary comp_3176official enamed cameraOverlayintermediary comp_3306official fnamed allowedEntitiesintermediary comp_3177official gnamed dispensableintermediary comp_3178official hnamed swappableintermediary comp_3213official inamed damageOnHurtintermediary comp_3214official j
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Optional<RegistryEntryList<EntityType<?>>> The field for theallowedEntitiesrecord component.private final Optional<RegistryKey<EquipmentAsset>> The field for theassetIdrecord component.private final Optional<Identifier> The field for thecameraOverlayrecord component.static final com.mojang.serialization.Codec<EquippableComponent> private final booleanThe field for thedamageOnHurtrecord component.private final booleanThe field for thedispensablerecord component.private final RegistryEntry<SoundEvent> The field for theequipSoundrecord component.static final PacketCodec<RegistryByteBuf, EquippableComponent> private final EquipmentSlotThe field for theslotrecord component.private final booleanThe field for theswappablerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionEquippableComponent(EquipmentSlot equipmentSlot, RegistryEntry<SoundEvent> registryEntry, Optional<RegistryKey<EquipmentAsset>> optional, Optional<Identifier> optional2, Optional<RegistryEntryList<EntityType<?>>> optional3, boolean bool, boolean bool2, boolean bool3) -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theallowedEntitiesrecord component.booleanallows(EntityType<?> entityType) assetId()Returns the value of theassetIdrecord component.static EquippableComponent.Builderbuilder(EquipmentSlot slot) Returns the value of thecameraOverlayrecord component.booleanReturns the value of thedamageOnHurtrecord component.booleanReturns the value of thedispensablerecord component.final booleanIndicates whether some other object is "equal to" this one.equip(ItemStack stack, PlayerEntity player) Returns the value of theequipSoundrecord component.final inthashCode()Returns a hash code value for this object.static EquippableComponentslot()Returns the value of theslotrecord component.booleanReturns the value of theswappablerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
slot
The field for theslotrecord component. -
equipSound
The field for theequipSoundrecord component. -
assetId
The field for theassetIdrecord component. -
cameraOverlay
The field for thecameraOverlayrecord component. -
allowedEntities
The field for theallowedEntitiesrecord component. -
dispensable
private final boolean dispensableThe field for thedispensablerecord component. -
swappable
private final boolean swappableThe field for theswappablerecord component. -
damageOnHurt
private final boolean damageOnHurtThe field for thedamageOnHurtrecord component. -
CODEC
- Mappings:
Namespace Name Mixin selector named CODECLnet/minecraft/component/type/EquippableComponent;CODEC:Lcom/mojang/serialization/Codec;intermediary field_54145Lnet/minecraft/class_10192;field_54145:Lcom/mojang/serialization/Codec;official aLdev;a:Lcom/mojang/serialization/Codec;
-
PACKET_CODEC
- Mappings:
Namespace Name Mixin selector named PACKET_CODECLnet/minecraft/component/type/EquippableComponent;PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;intermediary field_54146Lnet/minecraft/class_10192;field_54146:Lnet/minecraft/class_9139;official bLdev;b:Lyn;
-
-
Constructor Details
-
EquippableComponent
public EquippableComponent(EquipmentSlot equipmentSlot, RegistryEntry<SoundEvent> registryEntry, Optional<RegistryKey<EquipmentAsset>> optional, Optional<Identifier> optional2, Optional<RegistryEntryList<EntityType<?>>> optional3, boolean bool, boolean bool2, boolean bool3)
-
-
Method Details
-
ofCarpet
- Mappings:
Namespace Name Mixin selector named ofCarpetLnet/minecraft/component/type/EquippableComponent;ofCarpet(Lnet/minecraft/util/DyeColor;)Lnet/minecraft/component/type/EquippableComponent;intermediary method_64017Lnet/minecraft/class_10192;method_64017(Lnet/minecraft/class_1767;)Lnet/minecraft/class_10192;official aLdev;a(Lcvn;)Ldev;
-
builder
- Mappings:
Namespace Name Mixin selector named builderLnet/minecraft/component/type/EquippableComponent;builder(Lnet/minecraft/entity/EquipmentSlot;)Lnet/minecraft/component/type/EquippableComponent$Builder;intermediary method_64202Lnet/minecraft/class_10192;method_64202(Lnet/minecraft/class_1304;)Lnet/minecraft/class_10192$class_10217;official aLdev;a(Lbuu;)Ldev$a;
-
equip
- Mappings:
Namespace Name Mixin selector named equipLnet/minecraft/component/type/EquippableComponent;equip(Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/player/PlayerEntity;)Lnet/minecraft/util/ActionResult;intermediary method_64018Lnet/minecraft/class_10192;method_64018(Lnet/minecraft/class_1799;Lnet/minecraft/class_1657;)Lnet/minecraft/class_1269;official aLdev;a(Lcwq;Lcoy;)Lbsl;
-
allows
- Mappings:
Namespace Name Mixin selector named allowsLnet/minecraft/component/type/EquippableComponent;allows(Lnet/minecraft/entity/EntityType;)Zintermediary method_64015Lnet/minecraft/class_10192;method_64015(Lnet/minecraft/class_1299;)Zofficial aLdev;a(Lbut;)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 theslotrecord component.- Returns:
- the value of the
slotrecord component
-
equipSound
Returns the value of theequipSoundrecord component.- Returns:
- the value of the
equipSoundrecord component
-
assetId
Returns the value of theassetIdrecord component.- Returns:
- the value of the
assetIdrecord component
-
cameraOverlay
Returns the value of thecameraOverlayrecord component.- Returns:
- the value of the
cameraOverlayrecord component
-
allowedEntities
Returns the value of theallowedEntitiesrecord component.- Returns:
- the value of the
allowedEntitiesrecord component
-
dispensable
public boolean dispensable()Returns the value of thedispensablerecord component.- Returns:
- the value of the
dispensablerecord component
-
swappable
public boolean swappable()Returns the value of theswappablerecord component.- Returns:
- the value of the
swappablerecord component
-
damageOnHurt
public boolean damageOnHurt()Returns the value of thedamageOnHurtrecord component.- Returns:
- the value of the
damageOnHurtrecord component
-