Class GuideObjective

java.lang.Object
net.ixdarklord.folios.api.client.GuideObjective

public final class GuideObjective extends Object
Something the player makes progress on, shown with a bar: an objective of a quest page, and what a quest's entry shows on its row. In JSON it is an object naming what it follows, with an optional "label" (text with marks, or a translation key) in place of the one it makes for itself:
  • {"advancement": "minecraft:story/mine_stone"}: done once the advancement is;
  • {"read": "basics/first_steps"}: an entry of the book read;
  • {"category": "basics"}: how much of a category has been read;
  • {"book": true}: how much of the whole book has been read;
  • {"flag": "mymod:met_the_wizard"}: a flag set in code (Guides.setFlag(String, BooleanSupplier));
  • {"item": "minecraft:diamond", "count": 5}: items carried (an item, a #tag or a list);
  • {"source": "mymod:mana", "goal": 100}: a value a mod reports (GuideObjectives.register(Identifier, GuideObjectives.Source)), done when it reaches the goal.
  • Field Details

    • CODEC

      public static final com.mojang.serialization.Codec<GuideObjective> CODEC
  • Method Details

    • progress

      public float progress(GuideBook book)
      How far along it is, 0 to 1.
    • isDone

      public boolean isDone(GuideBook book)
    • isAllOrNothing

      public boolean isAllOrNothing()
      Whether it is done or not done, with nothing between: no bar of its own is shown for it.
    • label

      public net.minecraft.network.chat.Component label(GuideBook book)
      What it says, with how far along it is where that is a count.
    • items

      public @Nullable GuideStack items()
      The items it counts, for an icon; null for objectives that aren't about items.
    • progress

      public static float progress(GuideBook book, List<GuideObjective> objectives)
      How far along several objectives are together: the average of each.