Skip to content

List of TooltipFactories

B0IIZZ edited this page Oct 23, 2021 · 7 revisions

This is a List of valid text generators (so-called TooltipFactories) of this mod.

General TooltipFactories

id empty

  • Its just nothing

id literal

  • Fields: "text"
  • Behaves like the short form "".

id translated

  • Fields: "key" (Required) "arguments" (Optional: default is empty)
  • Returns a text translated to the current language of the given translation "key", which are i. e. defined in the assets/minecraft/lang/en_us.json. Many translations have arguments which can be filled in (i. e. book.pageIndicator), which can be provided by the TooltipFactory "arguments" giving one argument on each separate line

id formatted

  • Fields: "text" (Required) "bold" "italic" "strikethrough" "underline" "obfuscated" "centered" (All Optional: default false) "color" (Optional: no default value)
  • Formats the given TooltipFactory text according to the given format specifications. Please note that the centered parameter just centers the lines in relation to each other not to the whole tooltip itself

id conditional

  • Fields: "condition" "success" "fail"
  • Gives either the same output as the TooltipFactory success if the TooltipCondition condition is met or else the same output as the TooltipFactory fail

id limit

  • Fields: "text" "length"
  • Limits each line of the given TooltipFactory text to at most contain length characters.

id limit_lines

  • Fields: "text" "limit"
  • Limits the given TooltipFactory text to at most have limit lines.

id multiple

  • Fields: "texts"
  • Behaves like the short form []

id mix

  • Fields: "texts"(Required) "separate_lines" (Optional: default true)
  • Behaves almost like "multiple" but instead appends the given TooltipFactories texts on the same line. The additional parameter "separate_lines" is used to control whether everything is squished on one line or if it should match lines for each of the TooltipFactories:
lineA1 lineA2 lineB1 lineB2

or

lineA1 lineB1 
lineA2 lineB2

id effect

  • Fields: "rawId" "duration" (Both Required) "strength" (Optional: no default value)
  • For each of the lines of the TooltipFactories rawId, duration and strength a potion effect tooltip is generated based on the given information on each line

Nbt-related TooltipFactories

The concept of NbtPaths

A NbtPath is a way of specifying a path to the Nbt data of interest. The format is as follows:

  • children of a parent compound are specified after a . (compound.child)
  • elements of an array can be selected between [] ([123])
  • to select all elements of an array omit a number between the [] ([])
  • when multiple elements are selected, the are mostly treated individually by the TooltipFactories and put on separate lines.

id nbt_value

  • Fields: "tag" (Required) "go_into_compounds" "go_into_lists" "colored"(All Optional: default false)
  • Just returns the element at the specified tag. If the element is a compound go_into_compounds decides if it prints the whole compound of just writes {...}. go_into_lists decides the same for lists and [...]. if colored is true, all values will be colored yellow while all keys are colored gray.

id nbt_size

  • Fields: "tag"
  • Returns the size of the elements present at tag (length of lists, number of children for compounds, 1 for all non-null primitive values or else 0)

id nbt_text

  • Fields: "tag"
  • Returns the JSON-Text specified at the given tag

id nbt_retarget

  • Fields: "tag" "text"
  • All the paths of Nbt-related TooltipFactories inside of text will now be relative to tag. This is useful when extracting multiple things from a single Nbt-element inside of lists.