Skip to content

Configuring the Traveler's Compass

Abigail Flowers edited this page Apr 27, 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 #minecraft:is_nether, which means any modded biomes in that tag will be searched for as well. If you want to exclude a biome from this, override the tag using remove:true (a feature added by Forge/NeoForge to allow removing from tags without fully replacing them), like so:

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

Structures, however, are added manually since it's

Whitelist/Blacklist Structure

The whitelist/blacklist contents are data-driven, and determined by tags. There are three separate types of whitelist and blacklist, corresponding to each search object type (biome, structure, and structure_set). They all use the ID piglinproliferation:travellers_compass_[whitelist/blacklist] inside their respective folders. The file path of each tag is listed below:

  • data/piglinproliferation/tags/worldgen/biome/travellers_compass_whitelist.json
  • data/piglinproliferation/tags/worldgen/biome/travellers_compass_blacklist.json
  • data/piglinproliferation/tags/worldgen/structure/travellers_compass_whitelist.json
  • data/piglinproliferation/tags/worldgen/structure/travellers_compass_blacklist.json
  • data/piglinproliferation/tags/worldgen/structure_set/travellers_compass_whitelist.json
  • data/piglinproliferation/tags/worldgen/structure_set/travellers_compass_blacklist.json

Note: You might wonder why there is an extra type of list for structure_set - internally, any structure sets added to these lists will have all of the structures inside them added to the structure whitelist/blacklist.

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.travellers_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 you can always override the automated logic by creating a key under item.piglinproliferation.travellers_compass.desc.[biome/structure].[namespace].[path], in case it produces a weird result. [biome/structure].[namespace].[path] is checked because this is the format that Minecraft uses for biomes (e.g. biome.minecraft.crimson_forest), so most mods will likely follow it. Minecraft has 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.

However, this doesn't work for any other languages, 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 Traveller's Compass, i t's always ideal to create a item.piglinproliferation.travellers_compass.desc.[namespace].[path] translation to avoid these issues.

Clone this wiki locally