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
  • Field Details

    • slot

      private final EquipmentSlot slot
      The field for the slot record component.
    • equipSound

      private final RegistryEntry<SoundEvent> equipSound
      The field for the equipSound record component.
    • model

      private final Optional<Identifier> model
      The field for the model record component.
    • cameraOverlay

      private final Optional<Identifier> cameraOverlay
      The field for the cameraOverlay record component.
    • allowedEntities

      private final Optional<RegistryEntryList<EntityType<?>>> allowedEntities
      The field for the allowedEntities record component.
    • dispensable

      private final boolean dispensable
      The field for the dispensable record component.
    • swappable

      private final boolean swappable
      The field for the swappable record component.
    • damageOnHurt

      private final boolean damageOnHurt
      The field for the damageOnHurt record component.
    • CODEC

      public static final com.mojang.serialization.Codec<EquippableComponent> 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

      public static final PacketCodec<RegistryByteBuf,EquippableComponent> 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

  • Method Details

    • ofCarpet

      public static EquippableComponent ofCarpet(DyeColor color)
      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

      public static EquippableComponent.Builder builder(EquipmentSlot slot)
      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

      public ActionResult equip(ItemStack stack, PlayerEntity player)
      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

      public boolean allows(EntityType<?> entityType)
      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

      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.
    • slot

      public EquipmentSlot slot()
      Returns the value of the slot record component.
      Returns:
      the value of the slot record component
    • equipSound

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

      public Optional<Identifier> model()
      Returns the value of the model record component.
      Returns:
      the value of the model record component
    • cameraOverlay

      public Optional<Identifier> cameraOverlay()
      Returns the value of the cameraOverlay record component.
      Returns:
      the value of the cameraOverlay record component
    • allowedEntities

      public Optional<RegistryEntryList<EntityType<?>>> allowedEntities()
      Returns the value of the allowedEntities record component.
      Returns:
      the value of the allowedEntities record component
    • dispensable

      public boolean dispensable()
      Returns the value of the dispensable record component.
      Returns:
      the value of the dispensable record component
    • swappable

      public boolean swappable()
      Returns the value of the swappable record component.
      Returns:
      the value of the swappable record component
    • damageOnHurt

      public boolean damageOnHurt()
      Returns the value of the damageOnHurt record component.
      Returns:
      the value of the damageOnHurt record component