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
Modifier and TypeFieldDescriptionstatic final BinaryTagSerializer
<Equippable> static final NetworkBuffer.Type
<Equippable> -
Constructor Summary
ConstructorDescriptionEquippable
(@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 aEquippable
record class. -
Method Summary
Modifier and TypeMethodDescription@Nullable ObjectSet
<EntityType> Returns the value of theallowedEntities
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.@NotNull SoundEvent
Returns the value of theequipSound
record component.final int
hashCode()
Returns a hash code value for this object.@Nullable String
model()
Returns the value of themodel
record component.@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 ObjectSet<EntityType> allowedEntities) @NotNull Equippable
withCameraOverlay
(@Nullable String cameraOverlay) @NotNull Equippable
withDamageOnHurt
(boolean damageOnHurt) @NotNull Equippable
withDispensable
(boolean dispensable) @NotNull Equippable
withEquipSound
(@NotNull SoundEvent equipSound) @NotNull Equippable
@NotNull Equippable
withSlot
(@NotNull EquipmentSlot slot) @NotNull Equippable
withSwappable
(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 aEquippable
record class.- Parameters:
slot
- the value for theslot
record componentequipSound
- the value for theequipSound
record componentmodel
- the value for themodel
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 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 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
-
model
Returns the value of themodel
record component.- Returns:
- the value of the
model
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
-