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 aEquippable
record class. -
Method Summary
Modifier and TypeMethodDescription@Nullable RegistryTag
<EntityType> Returns the value of theallowedEntities
record component.@Nullable String
assetId()
Returns the value of theassetId
record component.@Nullable String
Returns the value of thecameraOverlay
record component.boolean
Returns the value of thedamageOnHurt
record component.boolean
Returns the value of thedispensable
record component.final boolean
Indicates whether some other object is "equal to" this one.boolean
Returns the value of theequipOnInteract
record component.@NotNull SoundEvent
Returns the value of theequipSound
record component.final int
hashCode()
Returns a hash code value for this object.@NotNull EquipmentSlot
slot()
Returns the value of theslot
record component.boolean
Returns the value of theswappable
record component.final String
toString()
Returns a string representation of this record class.@NotNull Equippable
withAllowedEntities
(@Nullable RegistryTag<EntityType> allowedEntities) @NotNull Equippable
withAssetId
(@Nullable String assetId) @NotNull Equippable
withCameraOverlay
(@Nullable String cameraOverlay) @NotNull Equippable
withDamageOnHurt
(boolean damageOnHurt) @NotNull Equippable
withDispensable
(boolean dispensable) @NotNull Equippable
withEquipOnInteract
(boolean equipOnInteract) @NotNull Equippable
withEquipSound
(@NotNull SoundEvent equipSound) @NotNull Equippable
withSlot
(@NotNull EquipmentSlot slot) @NotNull Equippable
withSwappable
(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 aEquippable
record class.- Parameters:
slot
- the value for theslot
record componentequipSound
- the value for theequipSound
record componentassetId
- the value for theassetId
record componentcameraOverlay
- the value for thecameraOverlay
record componentallowedEntities
- the value for theallowedEntities
record componentdispensable
- the value for thedispensable
record componentswappable
- the value for theswappable
record componentdamageOnHurt
- the value for thedamageOnHurt
record componentequipOnInteract
- the value for theequipOnInteract
record component
-
-
Method Details
-
withSlot
-
withEquipSound
-
withAssetId
-
withCameraOverlay
-
withAllowedEntities
@NotNull public @NotNull Equippable withAllowedEntities(@Nullable @Nullable RegistryTag<EntityType> allowedEntities) -
withDispensable
-
withSwappable
-
withDamageOnHurt
-
withEquipOnInteract
-
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 thecompare
method from their corresponding wrapper classes. -
slot
Returns the value of theslot
record component.- Returns:
- the value of the
slot
record component
-
equipSound
Returns the value of theequipSound
record component.- Returns:
- the value of the
equipSound
record component
-
assetId
Returns the value of theassetId
record component.- Returns:
- the value of the
assetId
record component
-
cameraOverlay
Returns the value of thecameraOverlay
record component.- Returns:
- the value of the
cameraOverlay
record component
-
allowedEntities
Returns the value of theallowedEntities
record component.- Returns:
- the value of the
allowedEntities
record component
-
dispensable
public boolean dispensable()Returns the value of thedispensable
record component.- Returns:
- the value of the
dispensable
record component
-
swappable
public boolean swappable()Returns the value of theswappable
record component.- Returns:
- the value of the
swappable
record component
-
damageOnHurt
public boolean damageOnHurt()Returns the value of thedamageOnHurt
record component.- Returns:
- the value of the
damageOnHurt
record component
-
equipOnInteract
public boolean equipOnInteract()Returns the value of theequipOnInteract
record component.- Returns:
- the value of the
equipOnInteract
record component
-