Class HoverEvent<V>

    • Method Detail

      • showText

        public static @NonNull HoverEvent<Component> showText​(@NonNull ComponentLike text)
        Creates a hover event that shows text on hover.
        Parameters:
        text - the text to show on hover
        Returns:
        a hover event
        Since:
        4.2.0
      • showText

        public static @NonNull HoverEvent<Component> showText​(@NonNull Component text)
        Creates a hover event that shows text on hover.
        Parameters:
        text - the text to show on hover
        Returns:
        a hover event
        Since:
        4.0.0
      • showItem

        public static @NonNull HoverEvent<HoverEvent.ShowItem> showItem​(@NonNull net.kyori.adventure.key.Key item,
                                                                        @org.checkerframework.checker.index.qual.NonNegative int count)
        Creates a hover event that shows an item on hover.
        Parameters:
        item - the item
        count - the count
        Returns:
        a hover event
        Since:
        4.0.0
      • showItem

        public static @NonNull HoverEvent<HoverEvent.ShowItem> showItem​(@NonNull net.kyori.adventure.key.Key item,
                                                                        @org.checkerframework.checker.index.qual.NonNegative int count,
                                                                        @Nullable BinaryTagHolder nbt)
        Creates a hover event that shows an item on hover.
        Parameters:
        item - the item
        count - the count
        nbt - the nbt
        Returns:
        a hover event
        Since:
        4.0.0
      • showItem

        public static @NonNull HoverEvent<HoverEvent.ShowItem> showItem​(@NonNull HoverEvent.ShowItem item)
        Creates a hover event that shows an item on hover.
        Parameters:
        item - the item to show on hover
        Returns:
        a hover event
        Since:
        4.0.0
      • showEntity

        public static @NonNull HoverEvent<HoverEvent.ShowEntity> showEntity​(@NonNull net.kyori.adventure.key.Key type,
                                                                            @NonNull UUID id)
        Creates a hover event that show information about an entity on hover.
        Parameters:
        type - the type
        id - the id
        Returns:
        a ShowEntity
        Since:
        4.0.0
      • showEntity

        public static @NonNull HoverEvent<HoverEvent.ShowEntity> showEntity​(@NonNull net.kyori.adventure.key.Key type,
                                                                            @NonNull UUID id,
                                                                            @Nullable Component name)
        Creates a hover event that show information about an entity on hover.
        Parameters:
        type - the type
        id - the id
        name - the name
        Returns:
        a ShowEntity
        Since:
        4.0.0
      • showEntity

        public static @NonNull HoverEvent<HoverEvent.ShowEntity> showEntity​(@NonNull HoverEvent.ShowEntity entity)
        Creates a hover event that show information about an entity on hover.
        Parameters:
        entity - the entity to show on hover
        Returns:
        a hover event
        Since:
        4.0.0
      • hoverEvent

        public static <V> @NonNull HoverEvent<V> hoverEvent​(@NonNull HoverEvent.Action<V> action,
                                                            @NonNull V value)
        Creates a hover event.
        Type Parameters:
        V - the value type
        Parameters:
        action - the action
        value - the value
        Returns:
        a click event
        Since:
        4.0.0
      • action

        public @NonNull HoverEvent.Action<V> action()
        Gets the hover event action.
        Returns:
        the hover event action
        Since:
        4.0.0
      • value

        public @NonNull V value()
        Gets the hover event value.
        Returns:
        the hover event value
        Since:
        4.0.0
      • value

        public @NonNull HoverEvent<V> value​(@NonNull V value)
        Sets the hover event value.
        Parameters:
        value - the hover event value
        Returns:
        a hover event
        Since:
        4.0.0
      • withRenderedValue

        public <C> @NonNull HoverEvent<V> withRenderedValue​(@NonNull ComponentRenderer<C> renderer,
                                                            @NonNull C context)
        Returns a hover event with the value rendered using renderer when possible.
        Type Parameters:
        C - the context type
        Parameters:
        renderer - the renderer
        context - the render context
        Returns:
        a hover event
        Since:
        4.0.0
      • asHoverEvent

        public @NonNull HoverEvent<V> asHoverEvent​(@NonNull UnaryOperator<V> op)
        Description copied from interface: HoverEventSource
        Creates a hover event with value derived from this object.

        The event value will be passed through the provided callback to allow transforming the original value of the event.

        Specified by:
        asHoverEvent in interface HoverEventSource<V>
        Parameters:
        op - transformation on value
        Returns:
        a hover event
      • equals

        public boolean equals​(@Nullable Object other)
        Overrides:
        equals in class Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • examinableProperties

        public @NonNull Stream<? extends net.kyori.examination.ExaminableProperty> examinableProperties()
        Specified by:
        examinableProperties in interface net.kyori.examination.Examinable