mc-wiki / minecraft-mod-heywiki

A Minecraft mod that allows you to press H (customizable) to open the Minecraft Wiki page of the block/item/entity you're aiming at.
https://minecraft.wiki/MCW:MOD
GNU Lesser General Public License v3.0
64 stars 8 forks source link


Hey Wiki

CurseForge Modrinth Crowdin

fabric neoforge crowdin

Hey Wiki is a client mod made by the the Minecraft Wiki community that allows you to press H ( customizable) to open the wiki page of the block, item, or entity you're aiming at, whether it's from vanilla or a mod. Hey Wiki supports Fabric and NeoForge.

Features

It is also supported to use MCBrowser and MCEF for in-game browsing.

I didn't know that this mod is kinda like Lexica Botania but it is.

https://github.com/mc-wiki/minecraft-mod-heywiki/assets/45287180/b0650362-1fe9-46ff-83a1-48219d5fcc05

How to use

  1. Install the mod. You can download it from Modrinth or CurseForge. Don't forget to install the dependencies.
  2. Point at a block/entity with your crosshair or hover over an item in your inventory with your cursor.
  3. Press the keybind (default is H).
  4. Either confirm the action or copy the link to your clipboard in the screen that pops up.

Configuration

Optionally, you can change these behaviors in the config menu:

[!TIP] You need to install Mod Menu to access the config menu on Fabric.

Commands

These commands are available:

Note that if you open a page with a command, the confirmation screen will not appear.

[[Wiki links]] in chat

Hey Wiki supports [[wiki links]] in chat. When you send a message with [[wiki link]] syntax, Hey Wiki will replace it with a clickable link. The page name can include a namespace.

This also supports interwiki links. For example:

Supported wikis

Currently, Hey Wiki supports the following wikis:

If you want to add support for other wikis, you can file an issue. In addition, you can also add support for other wikis by using a resource pack.

APIs

Resource pack

[!NOTE] This API is stable since v1.6.0.

Hey Wiki supports using resource pack to add support for other wikis. To do so, create a JSON file in the assets/<namespace>/wiki_family/ folder in your resource pack with the following format:

{
  // The namespaces that is bound to the wiki family
  "namespace": [
    "minecraft"
  ],
  // List of different language wikis
  "wikis": [
    {
      // The URL pattern for articles. %s will be replaced with the query
      "article_url": "https://minecraft.wiki/?search=%s",
      // (Optional) If the wiki is a MediaWiki wiki, the API URL
      "mw_api_url": "https://minecraft.wiki/api.php",
      // (Optional) The URL pattern for searching. %s will be replaced with the query.
      "search_url": "https://minecraft.wiki/?search=%s",
      // (Optional) The page name for the random article
      "random_article": "Special:RandomRootPage/Main",
      // (Optional) How Hey Wiki should fetch excerpts from the wiki. Either "text_extracts" or "none".
      // "text_extracts" only works for MediaWiki sites with the TextExtracts and PageImages extension installed. You can check this by visiting Special:Version on the wiki.
      "excerpt": "text_extracts",
      // (Optional) Which provider to use for autocompleted search. Either "mediawiki" or "algolia".
      "search_provider": "mediawiki",
      // (Optional) If you use algolia as search provider, you MUST fill out the following fields
      "algolia": {
        "api_url": "https://example-dsn.algolia.net/",
        "index_name": "example",
        "api_key": "efcc14a8c70a1489d18cfd565cce53ca",
        "app_id": "9957A67102"
      },
      "language": {
        // The language code of the wiki
        "wiki_language": "en",
        // Whether this is the main language. If true, this language will be fallback if no other language matches
        "main": true,
        // The default in-game language that the wiki supports. This will be fallback if the in-game language is not supported by the wiki
        "default": "en_us",
        // If the regex matches the in-game language, this wiki will be used when config is auto
        "regex": "^en_.*",
        // (Optional) Ditto, but for exclusion
        "exclude": null,
        // (Optional) A custom language code that allows you to override translation keys to specific pages. A translation file should exist at assets/<namespace>/lang/<lang_override>.json
        "lang_override": "minecraft_en"
      }
    },
    {
      // Another language
      "article_url": "https://de.minecraft.wiki/?search=%s",
      "language": {
        "wiki_language": "de",
        "default": "de_de",
        "regex": "^de_.*",
        "exclude": null
      }
    }
  ]
}

You also want to include a translation file in assets/<namespace>/lang/ folder with the following format:

{
  // Assuming the definition is located at `assets/heywiki/wiki_family/minecraft.json`
  "wiki_family.heywiki.minecraft": "Minecraft Wiki"
}

Custom item via data component or NBT

[!WARNING] This API is an experimental feature and might change at any time.

Data pack and custom server authors can use heywiki:identifier, heywiki:translation_key and heywiki:fallback_title in custom_data component to provide custom namespace and name for an item. However, this only accounts for custom items. For 1.20.4, you can populate these fields directly in NBT.

You need to use the method above to register a new wiki with a custom namespace using resource pack. If it is not feasible to ask your players to download a resource pack, we can also ship it with the mod itself.

For example, on "niceserver", to have a bone item to resolve to the "Drill" page, you will first need to register the "niceserver" namespace per above. Then you can give the player this item:

1.21:

/give @s minecraft:bone[minecraft:custom_data={"heywiki:identifier": "niceserver:drill", "heywiki:fallback_title": "Drill", "heywiki:translation_key": "item.niceserver.drill"}]

1.20.4:

/give @s minecraft:bone{"heywiki:identifier": "niceserver:drill", "heywiki:translation_key": "item.niceserver.drill"}

Dependencies

For Fabric:

For NeoForge:

Versioning

Hey Wiki

Hey Wiki itself follows Semantic Versioning. The version number is in the format of <major>.<minor>.<patch>[-<prerelease>]. The version number is incremented based on the following rules:

Minecraft

Hey Wiki supports multiple versions of Minecraft.

Every Minecraft version is assigned a support status:

The current Minecraft release and the master branches are always Active. Pull requests should almost always go to master. If they're accepted, they should be cherry-picked to other Active branches.

When a new snapshot releases, master branch is updated to that snapshot. Snapshots might receive only one version or no version at all. Only Fabric is supported for snapshots.

Old Minecraft versions are provided with Long Term Support (LTS) based on their popularity and the community's interest. LTS versions receive Active support at first. After some time, they will be downgraded to Maintenance. Old snapshots are not supported.

The following table shows which versions are supported:

Git branch Minecraft version Supported? Is LTS? Modloader
master 1.21.2, 1.21.3 Active (Latest) ? Fabric, Neoforge
mc/1.21.1 1.21, 1.21.1 Active (LTS) Yes Fabric, Neoforge
mc/1.20.6 1.20.6 EOL No Fabric, Neoforge
mc/1.20.5 1.20.5 EOL No Fabric, Neoforge
mc/1.20.4 1.20.4 Maintenance (LTS) Yes Fabric, Neoforge
N/A Outdated snapshots EOL No Fabric