Class HoverEvent


  • public final class HoverEvent
    extends Object
    • Constructor Detail

      • HoverEvent

        public HoverEvent​(HoverEvent.Action action,
                          Content... contents)
        Creates event with an action and a list of contents.
        Parameters:
        action - action of this event
        contents - array of contents, provide at least one
      • HoverEvent

        public HoverEvent​(HoverEvent.Action action,
                          List<Content> contents)
        Creates a new HoverEvent instance.
        Parameters:
        action - The action of this event.
        contents - List of contents to provide for this event.
    • Method Detail

      • getClass

        public static Class<?> getClass​(HoverEvent.Action action,
                                        boolean array)
        Gets the appropriate Content class for an HoverEvent.Action for the GSON serialization
        Parameters:
        action - the action to get for
        array - if to return the arrayed class
        Returns:
        the class
      • getContents

        public List<Content> getContents()
        List of contents to provide for this event.
      • isLegacy

        public boolean isLegacy()
        Returns whether this hover event is prior to 1.16
      • hashCode

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

        public void setLegacy​(boolean legacy)
        Returns whether this hover event is prior to 1.16