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 Summary
FieldsModifier and TypeFieldDescriptionstatic final BinaryTagSerializer<Equippable> static final NetworkBuffer.Type<Equippable> -
Constructor Summary
ConstructorsConstructorDescriptionEquippable(@NotNull EquipmentSlot slot, @NotNull SoundEvent equipSound, @Nullable String model, @Nullable String cameraOverlay, @Nullable ObjectSet<EntityType> allowedEntities, boolean dispensable, boolean swappable, boolean damageOnHurt) Creates an instance of aEquippablerecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable ObjectSet<EntityType> Returns the value of theallowedEntitiesrecord 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.@NotNull SoundEventReturns the value of theequipSoundrecord component.final inthashCode()Returns a hash code value for this object.@Nullable Stringmodel()Returns the value of themodelrecord component.@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 ObjectSet<EntityType> allowedEntities) @NotNull EquippablewithCameraOverlay(@Nullable String cameraOverlay) @NotNull EquippablewithDamageOnHurt(boolean damageOnHurt) @NotNull EquippablewithDispensable(boolean dispensable) @NotNull EquippablewithEquipSound(@NotNull SoundEvent equipSound) @NotNull Equippable@NotNull EquippablewithSlot(@NotNull EquipmentSlot slot) @NotNull EquippablewithSwappable(boolean swappable)
-
Field Details
-
NETWORK_TYPE
-
NBT_TYPE
-
-
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 aEquippablerecord class.- Parameters:
slot- the value for theslotrecord componentequipSound- the value for theequipSoundrecord componentmodel- the value for themodelrecord 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 component
-
-
Method Details
-
withSlot
-
withEquipSound
-
withModel
-
withCameraOverlay
-
withAllowedEntities
@NotNull public @NotNull Equippable withAllowedEntities(@Nullable @Nullable ObjectSet<EntityType> allowedEntities) -
withDispensable
-
withSwappable
-
withDamageOnHurt
-
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
-
model
Returns the value of themodelrecord component.- Returns:
- the value of the
modelrecord 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
-