Package devs.beer.nativepackets.api
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSupported vanilla hover actions. -
Constructor Summary
ConstructorsConstructorDescriptionNativeHoverEvent(NativeHoverEvent.Action action, NativeText text, String typeKey, int itemCount, UUID entityId, NativeText entityName) Creates an instance of aNativeHoverEventrecord class. -
Method Summary
Modifier and TypeMethodDescriptionaction()Returns the value of theactionrecord component.entityId()Returns the value of theentityIdrecord component.Returns the value of theentityNamerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of theitemCountrecord component.static NativeHoverEventshowEntity(String entityType, UUID id, NativeText name) static NativeHoverEventstatic NativeHoverEventshowText(NativeText text) text()Returns the value of thetextrecord component.final StringtoString()Returns a string representation of this record class.typeKey()Returns the value of thetypeKeyrecord component.
-
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 aNativeHoverEventrecord class.- Parameters:
action- the value for theactionrecord componenttext- the value for thetextrecord componenttypeKey- the value for thetypeKeyrecord componentitemCount- the value for theitemCountrecord componententityId- the value for theentityIdrecord componententityName- the value for theentityNamerecord component
-
-
Method Details
-
showText
-
showItem
-
showEntity
-
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 '=='. -
action
Returns the value of theactionrecord component.- Returns:
- the value of the
actionrecord component
-
text
Returns the value of thetextrecord component.- Returns:
- the value of the
textrecord component
-
typeKey
Returns the value of thetypeKeyrecord component.- Returns:
- the value of the
typeKeyrecord component
-
itemCount
public int itemCount()Returns the value of theitemCountrecord component.- Returns:
- the value of the
itemCountrecord component
-
entityId
Returns the value of theentityIdrecord component.- Returns:
- the value of the
entityIdrecord component
-
entityName
Returns the value of theentityNamerecord component.- Returns:
- the value of the
entityNamerecord component
-