Class PaperBrigadier

java.lang.Object
io.papermc.paper.brigadier.PaperBrigadier

@Deprecated(forRemoval=true, since="1.20.6") public final class PaperBrigadier extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
for removal. See MessageComponentSerializer for a direct replacement of functionality found in this class. As a general entrypoint to brigadier on paper, see Commands.
Helper methods to bridge the gaps between Brigadier and Paper-MojangAPI.
  • Method Summary

    Modifier and Type
    Method
    Description
    static @NonNull net.kyori.adventure.text.Component
    componentFromMessage(@NonNull com.mojang.brigadier.Message message)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Create a new Component from a Brigadier Message.
    static @NonNull com.mojang.brigadier.Message
    message(@NonNull net.kyori.adventure.text.ComponentLike componentLike)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Create a new Brigadier Message from a ComponentLike.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • message

      public static @NonNull com.mojang.brigadier.Message message(@NonNull net.kyori.adventure.text.ComponentLike componentLike)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create a new Brigadier Message from a ComponentLike.

      Mostly useful for creating rich suggestion tooltips in combination with other Paper-MojangAPI APIs.

      Parameters:
      componentLike - The ComponentLike to use for the Message contents
      Returns:
      A new Brigadier Message
    • componentFromMessage

      public static @NonNull net.kyori.adventure.text.Component componentFromMessage(@NonNull com.mojang.brigadier.Message message)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create a new Component from a Brigadier Message.

      If the Message was created from a Component, it will simply be converted back, otherwise a new TextComponent will be created with the content of Message.getString()

      Parameters:
      message - The Message to create a Component from
      Returns:
      The created Component