Record Class Equippable
java.lang.Object
java.lang.Record
net.minestom.server.item.component.Equippable
public record Equippable(EquipmentSlot slot, SoundEvent equipSound, @Nullable String assetId, @Nullable String cameraOverlay, @Nullable RegistryTag<EntityType> allowedEntities, boolean dispensable, boolean swappable, boolean damageOnHurt, boolean equipOnInteract, boolean canBeSheared, SoundEvent shearingSound)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<Equippable> static final SoundEventstatic final SoundEventstatic final NetworkBuffer.Type<Equippable> -
Constructor Summary
ConstructorsConstructorDescriptionEquippable(EquipmentSlot slot, SoundEvent equipSound, @Nullable String assetId, @Nullable String cameraOverlay, @Nullable RegistryTag<EntityType> allowedEntities, boolean dispensable, boolean swappable, boolean damageOnHurt, boolean equipOnInteract, boolean canBeSheared, SoundEvent shearingSound) Creates an instance of aEquippablerecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theallowedEntitiesrecord component.assetId()Returns the value of theassetIdrecord component.Returns the value of thecameraOverlayrecord component.booleanReturns the value of thecanBeShearedrecord 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.Returns the value of theequipSoundrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theshearingSoundrecord component.slot()Returns the value of theslotrecord component.booleanReturns the value of theswappablerecord component.final StringtoString()Returns a string representation of this record class.withAllowedEntities(@Nullable RegistryTag<EntityType> allowedEntities) withAssetId(@Nullable String assetId) withCameraOverlay(@Nullable String cameraOverlay) withCanBeSheared(boolean canBeSheared) withDamageOnHurt(boolean damageOnHurt) withDispensable(boolean dispensable) withEquipOnInteract(boolean equipOnInteract) withEquipSound(SoundEvent equipSound) withShearingSound(SoundEvent shearingSound) withSlot(EquipmentSlot slot) withSwappable(boolean swappable)
-
Field Details
-
DEFAULT_EQUIP_SOUND
-
DEFAULT_SHEARING_SOUND
-
NETWORK_TYPE
-
CODEC
-
-
Constructor Details
-
Equippable
public Equippable(EquipmentSlot slot, SoundEvent equipSound, @Nullable @Nullable String assetId, @Nullable @Nullable String cameraOverlay, @Nullable @Nullable RegistryTag<EntityType> allowedEntities, boolean dispensable, boolean swappable, boolean damageOnHurt, boolean equipOnInteract, boolean canBeSheared, SoundEvent shearingSound) 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 componentcanBeSheared- the value for thecanBeShearedrecord componentshearingSound- the value for theshearingSoundrecord component
-
-
Method Details
-
withSlot
-
withEquipSound
-
withAssetId
-
withCameraOverlay
-
withAllowedEntities
-
withDispensable
-
withSwappable
-
withDamageOnHurt
-
withEquipOnInteract
-
withCanBeSheared
-
withShearingSound
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
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
-
cameraOverlay
-
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
-
canBeSheared
public boolean canBeSheared()Returns the value of thecanBeShearedrecord component.- Returns:
- the value of the
canBeShearedrecord component
-
shearingSound
Returns the value of theshearingSoundrecord component.- Returns:
- the value of the
shearingSoundrecord component
-