Record Class NativeHoverEvent

java.lang.Object
java.lang.Record
devs.beer.nativepackets.api.NativeHoverEvent

public record NativeHoverEvent(NativeHoverEvent.Action action, NativeText text, String typeKey, int itemCount, UUID entityId, NativeText entityName) extends Record
Version-neutral hover event. Item data components beyond key/count are intentionally unsupported.
  • Constructor Details

    • NativeHoverEvent

      public NativeHoverEvent(NativeHoverEvent.Action action, @Nullable NativeText text, @Nullable String typeKey, int itemCount, @Nullable UUID entityId, @Nullable NativeText entityName)
      Creates an instance of a NativeHoverEvent record class.
      Parameters:
      action - the value for the action record component
      text - the value for the text record component
      typeKey - the value for the typeKey record component
      itemCount - the value for the itemCount record component
      entityId - the value for the entityId record component
      entityName - the value for the entityName record component
  • Method Details

    • showText

      public static NativeHoverEvent showText(NativeText text)
    • showItem

      public static NativeHoverEvent showItem(String itemKey, int count)
    • showEntity

      public static NativeHoverEvent showEntity(String entityType, UUID id, @Nullable NativeText name)
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • action

      public NativeHoverEvent.Action action()
      Returns the value of the action record component.
      Returns:
      the value of the action record component
    • text

      @Nullable public NativeText text()
      Returns the value of the text record component.
      Returns:
      the value of the text record component
    • typeKey

      @Nullable public String typeKey()
      Returns the value of the typeKey record component.
      Returns:
      the value of the typeKey record component
    • itemCount

      public int itemCount()
      Returns the value of the itemCount record component.
      Returns:
      the value of the itemCount record component
    • entityId

      @Nullable public UUID entityId()
      Returns the value of the entityId record component.
      Returns:
      the value of the entityId record component
    • entityName

      @Nullable public NativeText entityName()
      Returns the value of the entityName record component.
      Returns:
      the value of the entityName record component