File tree Expand file tree Collapse file tree
src/main/java/com/marcusslover/plus/lib/item Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -209,6 +209,26 @@ public boolean hasName() {
209209 return this .hasLore () ? ColorUtil .translateList (this .meta ().getLore ()) : new ArrayList <>();
210210 }
211211
212+ /**
213+ * Retrieves the lore text from the item's metadata if it exists.
214+ * The lore is a collection of additional text associated with the item.
215+ *
216+ * @return A list of {@link Text} objects representing the lore if present,
217+ * or null if the item has no metadata, no lore, or the lore is empty.
218+ * @since 4.4.0
219+ */
220+ public @ Nullable List <Text > loreTexts () {
221+ ItemMeta itemMeta = this .meta ();
222+ if (itemMeta == null || !itemMeta .hasLore ()) {
223+ return null ;
224+ }
225+ List <Component > loreComponents = itemMeta .lore ();
226+ if (loreComponents == null ) {
227+ return null ;
228+ }
229+ return loreComponents .stream ().map (Text ::of ).toList ();
230+ }
231+
212232 /**
213233 * Retrieves the lore components of the item.
214234 * If the item meta is null or does not contain lore, an empty list is returned.
You can’t perform that action at this time.
0 commit comments