Class ClickEvent

    • Method Detail

      • openUrl

        @NotNull
        public static @NotNull ClickEvent openUrl​(@NotNull
                                                  @NotNull java.lang.String url)
        Creates a click event that opens a url.
        Parameters:
        url - the url to open
        Returns:
        a click event
        Since:
        4.0.0
      • openUrl

        @NotNull
        public static @NotNull ClickEvent openUrl​(@NotNull
                                                  @NotNull java.net.URL url)
        Creates a click event that opens a url.
        Parameters:
        url - the url to open
        Returns:
        a click event
        Since:
        4.0.0
      • openFile

        @NotNull
        public static @NotNull ClickEvent openFile​(@NotNull
                                                   @NotNull java.lang.String file)
        Creates a click event that opens a file.

        This action is not readable, and may only be used locally on the client.

        Parameters:
        file - the file to open
        Returns:
        a click event
        Since:
        4.0.0
      • runCommand

        @NotNull
        public static @NotNull ClickEvent runCommand​(@NotNull
                                                     @NotNull java.lang.String command)
        Creates a click event that runs a command.
        Parameters:
        command - the command to run
        Returns:
        a click event
        Since:
        4.0.0
      • suggestCommand

        @NotNull
        public static @NotNull ClickEvent suggestCommand​(@NotNull
                                                         @NotNull java.lang.String command)
        Creates a click event that suggests a command.
        Parameters:
        command - the command to suggest
        Returns:
        a click event
        Since:
        4.0.0
      • changePage

        @NotNull
        public static @NotNull ClickEvent changePage​(@NotNull
                                                     @NotNull java.lang.String page)
        Creates a click event that changes to a page.
        Parameters:
        page - the page to change to
        Returns:
        a click event
        Since:
        4.0.0
      • changePage

        @NotNull
        public static @NotNull ClickEvent changePage​(int page)
        Creates a click event that changes to a page.
        Parameters:
        page - the page to change to
        Returns:
        a click event
        Since:
        4.0.0
      • copyToClipboard

        @NotNull
        public static @NotNull ClickEvent copyToClipboard​(@NotNull
                                                          @NotNull java.lang.String text)
        Creates a click event that copies text to the clipboard.
        Parameters:
        text - the text to copy to the clipboard
        Returns:
        a click event
        Since:
        4.0.0
        Since Minecraft:
        1.15
      • callback

        @NotNull
        public static @NotNull ClickEvent callback​(@NotNull
                                                   @NotNull ClickCallback<Audience> function)
        Create a click event that, when clicked, will schedule a callback function to be executed on the server.

        By default, this will be a single-use function that expires after the value of ClickCallback.DEFAULT_LIFETIME.

        Parameters:
        function - the function to execute
        Returns:
        a callback click event
        Since:
        4.13.0
      • callback

        @NotNull
        public static @NotNull ClickEvent callback​(@NotNull
                                                   @NotNull ClickCallback<Audience> function,
                                                   @NotNull ClickCallback.Options options)
        Create a click event that, when clicked, will schedule a callback function to be executed on the server.
        Parameters:
        function - the function to execute
        options - options to control how the callback will be stored on the server.
        Returns:
        a callback click event
        Since:
        4.13.0
      • callback

        @NotNull
        public static @NotNull ClickEvent callback​(@NotNull
                                                   @NotNull ClickCallback<Audience> function,
                                                   @NotNull
                                                   @NotNull java.util.function.Consumer<@NotNull ClickCallback.Options.Builder> optionsBuilder)
        Create a click event that, when clicked, will schedule a callback function to be executed on the server.
        Parameters:
        function - the function to execute
        optionsBuilder - function that will be called to configure the click callback options
        Returns:
        a callback click event
        Since:
        4.13.0
      • clickEvent

        @NotNull
        public static @NotNull ClickEvent clickEvent​(@NotNull
                                                     @NotNull ClickEvent.Action action,
                                                     @NotNull
                                                     @NotNull java.lang.String value)
        Creates a click event.
        Parameters:
        action - the action
        value - the value
        Returns:
        a click event
        Since:
        4.0.0
      • action

        @NotNull
        public @NotNull ClickEvent.Action action()
        Gets the click event action.
        Returns:
        the click event action
        Since:
        4.0.0
      • value

        @NotNull
        public @NotNull java.lang.String value()
        Gets the click event value.
        Returns:
        the click event value
        Since:
        4.0.0
      • equals

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

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

        @NotNull
        public @NotNull java.util.stream.Stream<? extends net.kyori.examination.ExaminableProperty> examinableProperties()
        Specified by:
        examinableProperties in interface net.kyori.examination.Examinable
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object