Record Class Equippable

java.lang.Object
java.lang.Record
net.minestom.server.item.component.Equippable

public record Equippable(@NotNull EquipmentSlot slot, @NotNull SoundEvent equipSound, @Nullable String model, @Nullable String cameraOverlay, @Nullable ObjectSet<EntityType> allowedEntities, boolean dispensable, boolean swappable, boolean damageOnHurt) extends Record
  • Field Details

  • Constructor Details

    • Equippable

      public Equippable(@NotNull @NotNull EquipmentSlot slot, @NotNull @NotNull SoundEvent equipSound, @Nullable @Nullable String model, @Nullable @Nullable String cameraOverlay, @Nullable @Nullable ObjectSet<EntityType> allowedEntities, boolean dispensable, boolean swappable, boolean damageOnHurt)
      Creates an instance of a Equippable record class.
      Parameters:
      slot - the value for the slot record component
      equipSound - the value for the equipSound record component
      model - the value for the model record component
      cameraOverlay - the value for the cameraOverlay record component
      allowedEntities - the value for the allowedEntities record component
      dispensable - the value for the dispensable record component
      swappable - the value for the swappable record component
      damageOnHurt - the value for the damageOnHurt record component
  • Method Details

    • withSlot

      @NotNull public @NotNull Equippable withSlot(@NotNull @NotNull EquipmentSlot slot)
    • withEquipSound

      @NotNull public @NotNull Equippable withEquipSound(@NotNull @NotNull SoundEvent equipSound)
    • withModel

      @NotNull public @NotNull Equippable withModel(@Nullable @Nullable String model)
    • withCameraOverlay

      @NotNull public @NotNull Equippable withCameraOverlay(@Nullable @Nullable String cameraOverlay)
    • withAllowedEntities

      @NotNull public @NotNull Equippable withAllowedEntities(@Nullable @Nullable ObjectSet<EntityType> allowedEntities)
    • withDispensable

      @NotNull public @NotNull Equippable withDispensable(boolean dispensable)
    • withSwappable

      @NotNull public @NotNull Equippable withSwappable(boolean swappable)
    • withDamageOnHurt

      @NotNull public @NotNull Equippable withDamageOnHurt(boolean damageOnHurt)
    • 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 o)
      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:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • slot

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

      @NotNull public @NotNull SoundEvent equipSound()
      Returns the value of the equipSound record component.
      Returns:
      the value of the equipSound record component
    • model

      @Nullable public @Nullable String model()
      Returns the value of the model record component.
      Returns:
      the value of the model record component
    • cameraOverlay

      @Nullable public @Nullable String cameraOverlay()
      Returns the value of the cameraOverlay record component.
      Returns:
      the value of the cameraOverlay record component
    • allowedEntities

      @Nullable public @Nullable ObjectSet<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