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 assetId, @Nullable String cameraOverlay, @Nullable RegistryTag<EntityType> allowedEntities, boolean dispensable, boolean swappable, boolean damageOnHurt, boolean equipOnInteract)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<Equippable> static final NetworkBuffer.Type<Equippable> -
Constructor Summary
ConstructorsConstructorDescriptionEquippable(@NotNull EquipmentSlot slot, @NotNull SoundEvent equipSound, @Nullable String assetId, @Nullable String cameraOverlay, @Nullable RegistryTag<EntityType> allowedEntities, boolean dispensable, boolean swappable, boolean damageOnHurt, boolean equipOnInteract) Creates an instance of aEquippablerecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable RegistryTag<EntityType> Returns the value of theallowedEntitiesrecord component.@Nullable StringassetId()Returns the value of theassetIdrecord component.@Nullable StringReturns 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.booleanReturns the value of theequipOnInteractrecord component.@NotNull SoundEventReturns the value of theequipSoundrecord component.final inthashCode()Returns a hash code value for this object.@NotNull EquipmentSlotslot()Returns the value of theslotrecord component.booleanReturns the value of theswappablerecord component.final StringtoString()Returns a string representation of this record class.@NotNull EquippablewithAllowedEntities(@Nullable RegistryTag<EntityType> allowedEntities) @NotNull EquippablewithAssetId(@Nullable String assetId) @NotNull EquippablewithCameraOverlay(@Nullable String cameraOverlay) @NotNull EquippablewithDamageOnHurt(boolean damageOnHurt) @NotNull EquippablewithDispensable(boolean dispensable) @NotNull EquippablewithEquipOnInteract(boolean equipOnInteract) @NotNull EquippablewithEquipSound(@NotNull SoundEvent equipSound) @NotNull EquippablewithSlot(@NotNull EquipmentSlot slot) @NotNull EquippablewithSwappable(boolean swappable)
-
Field Details
-
NETWORK_TYPE
-
CODEC
-
-
Constructor Details
-
Equippable
public Equippable(@NotNull @NotNull EquipmentSlot slot, @NotNull @NotNull SoundEvent equipSound, @Nullable @Nullable String assetId, @Nullable @Nullable String cameraOverlay, @Nullable @Nullable RegistryTag<EntityType> allowedEntities, boolean dispensable, boolean swappable, boolean damageOnHurt, boolean equipOnInteract) Creates an instance of aEquippablerecord class.- Parameters:
slot- the value for theslotrecord componentequipSound- the value for theequipSoundrecord componentassetId- the value for theassetIdrecord componentcameraOverlay- the value for thecameraOverlayrecord componentallowedEntities- the value for theallowedEntitiesrecord componentdispensable- the value for thedispensablerecord componentswappable- the value for theswappablerecord componentdamageOnHurt- the value for thedamageOnHurtrecord componentequipOnInteract- the value for theequipOnInteractrecord component
-
-
Method Details
-
withSlot
-
withEquipSound
-
withAssetId
-
withCameraOverlay
-
withAllowedEntities
@NotNull public @NotNull Equippable withAllowedEntities(@Nullable @Nullable RegistryTag<EntityType> allowedEntities) -
withDispensable
-
withSwappable
-
withDamageOnHurt
-
withEquipOnInteract
-
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
-
equipOnInteract
public boolean equipOnInteract()Returns the value of theequipOnInteractrecord component.- Returns:
- the value of the
equipOnInteractrecord component
-