Skip to content

Configuring the Traveler's Compass

Abigail Flowers edited this page Apr 29, 2024 · 3 revisions

The biomes and structures that the Traveler's Compass looks for can be heavily customised by users, modders and modpack developers!

From here onwards, 'search object' is taken to mean a biome or structure that the compass can look for.

Determining Potential Search Objects

When a compass is generated, it chooses a random search object to locate in the nether from the #piglinproliferation:travelers_compass_search biome and structure tags. The default biome tag adds all biomes in #c:is_nether (just #minecraft:is_nether in 1.20.1), which means any modded biomes in that tag will be searched for as well. If you want to exclude your biome, override the tag using remove:true (a feature in NeoForge that allows removing entries from tags without fully replacing them), like so:

data/piglinproliferation/tags/worldgen/biome/travelers_compass_search.json

{
   "remove": true,
   "values": [
      "mymod:custom_biome"
   ]
}

However, there is no tag for nether structures, and it would not be safe to get them automatically because a lot of modded structures are just rock formations and such. Therefore, only specific vanilla structures are searched for by default; in order to include your structure, you need to override the tag using replace:false:

data/piglinproliferation/tags/worldgen/structure/travelers_compass_search.json

{
   "replace": false,
   "values": [
      "mymod:custom_structure"
   ]
}

Localisation

The localised name for the search object shown in the compass description is determined by the following logic. Say we have the in-game object ID testmod:spongebob_squarepants for either a biome or a structure - the compass will:

  1. Check the translation key item.piglinproliferation.travelers_compass.desc.[biome/structure].testmod.spongebob_squarepants. If no translation is found:
  2. Check the translation key [biome/structure].testmod.spongebob_squarepants. If no translation is found:
  3. Take the path of the ID (spongebob_squarepants), replace the underscores with spaces, and capitalise each word to get "Spongebob Squarepants".

The idea behind this is that if the automated logic doesn't do what you want, you can always override it by creating a translation key under:

item.piglinproliferation.travelers_compass.desc.[biome/structure].[namespace].[path]

Otherwise it will check [biome/structure]. [namespace].[path], which is fairly reliable for biomes since this is ihis is the format that Minecraft uses for biomes (e.g. biome.minecraft.crimson_forest). However there are no default localisations for structures, so structure.[namespace].[path] will fail, and a fallback has to be used instead; assuming that the ID matches the actual name and that each word is separated by an underscore, we can get a plaintext name for the structure from its ID.

The issue with this method is that it only works for English, and it fails if a mod/datapack doesn't follow the regular naming convention. If you're trying to make a structure compatible with the Traveler's Compass, it's always ideal to create a manual translation key to avoid this.