Skip to content

Modonomicon Pages

DaFuqs edited this page Nov 8, 2024 · 6 revisions

Spectrum's guidebook "Colorful World" is powered by Modonomicon starting with Spectrum 1.8.x, an extensible guidebook API. Spectrum adds new page types where necessary. All available new page types are available to be used by modpacks and all addons for Spectrum that want to add content to Spectrum's guidebook, or their own.

Display a button that opens an url

Link Page

Example

{
  "type": "spectrum:link",
  "text": "book.spectrum.guidebook.brown_is_weird.page1.text",
  "url": "https://www.youtube.com/watch?v=wh4aWZRtTwU",
  "link_text": "book.spectrum.guidebook.brown_is_weird.page1.link_text"
}

Displaying a an ingredient or item with nbt

Nbt Spotlight Page

Example

{
  "type": "spectrum:nbt_spotlight",
  "item": {
	"item": "spectrum:memory",
	"nbt": {
	  "EntityTag": {
		"id": "minecraft:fox"
	  },
	  "TicksToManifest": 20
	}
  },
  "text": "book.spectrum.guidebook.memories.page0.text"
}

Displaying a list of items

Displays a list of items, 6 per line in up to 8 rows (less when you use text or a title).

Collection Page

Example

{
  "type": "spectrum:collection",
  "title": "block.spectrum.fusion_shrine",
  "items": [
	"spectrum:fusion_shrine_basalt",
	"spectrum:fusion_shrine_calcite"
  ],
  "text": "book.spectrum.guidebook.fusion_shrine.page0.text"
}

Buyable Hint

Features obfuscated text, a button that displays a button with text and a given cost. By clicking on the button the text will be revealed, given the player has the required items in the inventory. Spectrum uses this page in its guidebooks "idea" pages, to allow players to buy some tips if they are stuck in progression.

Cost should always be set to never feel grindy to the player, just acting as a small fee to encourage discovering more by themselves.

Idea Page

Example

{
  "type": "spectrum:hint",
  "title": "book.spectrum.guidebook.ideas.where_to_find",
  "completion_advancement": "spectrum:triggers/hints/azurite_page0",
  "cost": {
	"item": "spectrum:neolith",
	"count": 8
  },
  "text": "book.spectrum.guidebook.ideas.azurite.page0.text"
}

Displaying Arbitrary Textures

Displays any kind of image you supply it with by snipping out a part of a texture. For that it needs that texture's location (resource_path), the size of that image (resource_width & resource_height), the starting point (texture_x & texture_y), as well as it's size (texture_width & texture_height). Also takes a text property to display text below the image.

Snippet Page

Example

{
  "type": "spectrum:snippet",
  "title": "book.spectrum.guidebook.brewers_handbook.page0.title",
  "resource_path": "spectrum:textures/gui/guidebook/taswell.png",
  "resource_width": 116,
  "resource_height": 116,
  "texture_x": 0,
  "texture_y": 0,
  "texture_width": 116,
  "texture_height": 116,
  "border": false,
  "text": "book.spectrum.guidebook.brewers_handbook.page0.text"
}

Status Effect

Displays the framed icon of a status effect and some text.

Status Effect Page

Example

{
  "type": "spectrum:status_effect",
  "title": "effect.spectrum.swiftness",
  "status_effect_id": "spectrum:swiftness",
  "text": "book.spectrum.guidebook.swiftness.page0.text"
}

Checklist

Automatically generates a checklist based on the advancements the player has.

The checklist tag consists of a map of advancements to text. Advancements that the player has are displayed with strikethrough and a checkmark.

Checklist Page

Example

{
  "type": "spectrum:checklist",
  "checklist": {
	"spectrum:hidden/collect_pigment/black": "book.spectrum.guidebook.pigment.page1.checklist.entry0",
	"spectrum:hidden/collect_pigment/blue": "book.spectrum.guidebook.pigment.page1.checklist.entry1",
	"spectrum:hidden/collect_pigment/brown": "book.spectrum.guidebook.pigment.page1.checklist.entry2",
	"spectrum:hidden/collect_pigment/cyan": "book.spectrum.guidebook.pigment.page1.checklist.entry3",
	"spectrum:hidden/collect_pigment/gray": "book.spectrum.guidebook.pigment.page1.checklist.entry4",
	"spectrum:hidden/collect_pigment/green": "book.spectrum.guidebook.pigment.page1.checklist.entry5",
	"spectrum:hidden/collect_pigment/light_blue": "book.spectrum.guidebook.pigment.page1.checklist.entry6",
	"spectrum:hidden/collect_pigment/light_gray": "book.spectrum.guidebook.pigment.page1.checklist.entry7",
	"spectrum:hidden/collect_pigment/lime": "book.spectrum.guidebook.pigment.page1.checklist.entry8",
	"spectrum:hidden/collect_pigment/magenta": "book.spectrum.guidebook.pigment.page1.checklist.entry9",
	"spectrum:hidden/collect_pigment/orange": "book.spectrum.guidebook.pigment.page1.checklist.entry10",
	"spectrum:hidden/collect_pigment/pink": "book.spectrum.guidebook.pigment.page1.checklist.entry11",
	"spectrum:hidden/collect_pigment/purple": "book.spectrum.guidebook.pigment.page1.checklist.entry12",
	"spectrum:hidden/collect_pigment/red": "book.spectrum.guidebook.pigment.page1.checklist.entry13",
	"spectrum:hidden/collect_pigment/white": "book.spectrum.guidebook.pigment.page1.checklist.entry14",
	"spectrum:hidden/collect_pigment/yellow": "book.spectrum.guidebook.pigment.page1.checklist.entry15"
  },
  "text": "book.spectrum.guidebook.pigment.page1.text"
}

Confirmation Button

Displays a page containing a button that triggers an advancement criterion when pressed. Using this page type, you can actively query the player for confirmation, if they read an entry, understood something, or any other reason you would want some direct interaction.

  • checked_advancement: The advancement that is queried for completion to determine if the button has been pressed already.
  • button_text: The button's text when pressed/player has the advancement
  • button_text_confirmed: The button's text when pressed/player has the advancement
  • confirmation: The name of the checked advancements criterion that will be unlocked pressing the button

Confirmation Button Page

Example

The book page:

{
  "type": "spectrum:confirmation_button",
  "title": "book.spectrum.guidebook.the_art_of_brewing.drinking_age.title",
  "checked_advancement": "spectrum:triggers/confirmed_drinking_age",
  "button_text": "book.spectrum.guidebook.the_art_of_brewing.drinking_age.button_text",
  "button_text_confirmed": "book.spectrum.guidebook.the_art_of_brewing.drinking_age.button_text_confirmed",
  "confirmation": "confirm_drinking_age",
  "text": "book.spectrum.guidebook.the_art_of_brewing.drinking_age.text"
}

The accompanying advancement spectrum:triggers/confirmed_drinking_age:

{
  "criteria": {
    "confirmed_drinking_age": {
      "trigger":"spectrum:confirmation_button_pressed",
      "conditions": { "confirmation": "confirm_drinking_age" }
    }
  }
}
Clone this wiki locally