Package io.papermc.paper.brigadier
Class PaperBrigadier
java.lang.Object
io.papermc.paper.brigadier.PaperBrigadier
Helper methods to bridge the gaps between Brigadier and Paper-MojangAPI.
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull net.kyori.adventure.text.ComponentcomponentFromMessage(@NonNull com.mojang.brigadier.Message message) Create a newComponentfrom a BrigadierMessage.static @NonNull com.mojang.brigadier.Messagemessage(@NonNull net.kyori.adventure.text.ComponentLike componentLike) Create a new BrigadierMessagefrom aComponentLike.
-
Method Details
-
message
public static @NonNull com.mojang.brigadier.Message message(@NonNull net.kyori.adventure.text.ComponentLike componentLike) Create a new BrigadierMessagefrom aComponentLike.Mostly useful for creating rich suggestion tooltips in combination with other Paper-MojangAPI APIs.
- Parameters:
componentLike- TheComponentLiketo use for theMessagecontents- Returns:
- A new Brigadier
Message
-
componentFromMessage
public static @NonNull net.kyori.adventure.text.Component componentFromMessage(@NonNull com.mojang.brigadier.Message message) Create a newComponentfrom a BrigadierMessage.If the
Messagewas created from aComponent, it will simply be converted back, otherwise a newTextComponentwill be created with the content ofMessage.getString()- Parameters:
message- TheMessageto create aComponentfrom- Returns:
- The created
Component
-