Minecraft Data Packs / Game Mechanic

BarryMeyers Traveler Maps

  • check_circle Functions
  • check_circle Loot Tables
  • check_circle Predicates
  • 2,734 views, 15 today
  • 317 downloads, 2 today
  • 23
  • 23
  • 7
BarryMeyers avatar BarryMeyers
Level 15 : Journeyman Explorer
1
[​FR] Si vous vouliez ce data pack en français, je le tranduirais pour vous en me demandant.
[​EO] Se vi volus ĉi tiu data pack en esperanto, mi ĝin tradukus por vi tiam, kiam vi min demandus.

What is this?

Have you ever wanted to explore, but have wandered for hours without finding anything particularly useful? Do you want to be an explorer, but want some guidance, a direction? Now, wandering traders are willing to sell you information, but at a steep price. After all, information is never cheap.

Wandering traders will have a 33% chance to sell you an explorer map or a very special compass for 20 emeralds, leading you to the following structures in regions that nobody has explored yet:
  • Illager Mansions (1%)
  • Illager Outposts (5%)
  • Witch Huts (15%)
  • Desert Temples (10%)
  • Jungle Temples (10%)
  • Igloos (14%)
  • Ocean Monuments (9%)
  • Ocean Ruins (14%)
  • Villages (22%)
Underground structures are very common and usually nearby. Using a map to find them is a bit too easy, in my opinion. Shipwrecks are not an option, as dolphins already reveal their locations when fed. If you really want maps to these structures, you would have to add in the explorer map loot in the loot table JSON file yourself.

The chances of each structure map are based on my judgment of how worthy the loot of each structure are worth the cost of the map.

Just drag and drop the file into your data packs folder. No need to unzip.

Warnings
This data pack cannot be used on versions earlier than 1.15, as the game does not support predicates then.

Beware, due to the very nature of explorer maps, your game may freeze, albeit very slightly, upon the spawning of a wandering trader who has a map for sale or when a compass is converted in the nether. This freezing is unavoidable, since the game has to generate the landscape and structure in order to make a map. Even on my slow computer, the freezing only lasts a few seconds and no more. This is just a warning that one should heed.

A small known "half-bug" is that, sometimes, maps and compasses may overlap in destination with previous purchases. In other words, one map bought at one time and another bought at a different time may both lead to the same place, resulting in wasted emeralds. This is due to the generation of explorer maps. If users bought a map/compass, but refrain from exploring the destination, the destination will not be considered explored. Thus, maps and compasses would still point to the closest unexplored area. This is not really a bug, but more so a feature of explorer maps. I cannot resolve this half-issue, anyways. Just avoid stockpiling maps and compasses and actually use them to explore.

There is also a very rare bug. Sometimes, if users buy a map, it may result in a blank, unusable map. This happens when no destination structure is found at all, such as when the user has used world generation settings like single biome worlds, which prevent certain structures from spawning at all. This is not an issue that I can resolve.

Uninstall
To uninstall, please run the command /function bm_travelermaps:uninstall.


Compatibility
This data pack prepends a map to the beginning of the list of trades of the wandering trader. Thus, it is compatible with all other data packs that change the trader's base trades, appends, or prepends other trades to the trade list. Remember to load this data pack AFTER any data packs that change the trader's trades, rather than append/prepend trades.

However, it is not compatible with Regional Wandering Traders Data Pack, as their code structure overwrites the trader's trades a few times before stopping. I would provide a version that is compatible with the Regional Wandering Traders data pack, but only on request.


Technical Details (Spoilers!)
When a wandering trader is eligible to sell maps, there is a 75% chance of the loot being a map, with the probabilities for each structure listed in the list above. A map is generated and copied into the trader's list of trades. This always causes the game to freeze, due to the how explorer maps are generated and cannot be changed. The remaining 25% is a chance for loot to be a Mysterious Compass, which would lead users to a nearby ruined portal. An explorer map is generated for a ruined portal, then copied into the compass data, allowing the lodestone compass to be usable. Once in the nether at any time, the Mysterious Compass will shake and fizzle (with your imagination), converting into either a Wither or Piglin Compass, leading users to either a fortress or a bastion remnant. Both are equally likely.

Compasses still use explorer map generation to generate the destination coordinates, thus causing freezing. I tried various experimental methods of triangulation with commands, which does not cause the freezing of explorer maps and is extremely fast to calculate. However, Minecraft's scoreboard has limited precision. This causes the triangulation to become inaccurate for destinations at either very long distance away (>1500 blocks) or at very short range (<20 blocks). I tried my hardest to implement a non-freezing algorithm to lead users to nether structures, but the limited precision of the in-game mathematical commands is the main reason why faster, more user-friendly structure-finding algorithms were scrapped. I am sorry that this data pack has to rely on the slow explorer map generation in the end.
CreditThanks to Expert Coder and vdvman1 from the Minecraft Commands Discord Server and CerbonXD from Planet Minecraft for providing me help in making this data pack!
CompatibilityMinecraft 1.15
toMinecraft 1.18 Snapshot
Tags

3 Update Logs

Another Optimisation Update : 09/27/2021 3:01:41 pmSep 27th

Notable Changes:
  • Optimised the loot tables. Freezing is now nearly entirely gone. Thanks to CerbonXD for the help!
LOAD MORE LOGS

Create an account or sign in to comment.

1
09/27/2021 8:22 am
Level 11 : Journeyman Miner
CerbonXD
CerbonXD avatar
Berry, i made a datapack like your datapack but only to find Ruined portals. I managed to fix the freezing im my datapack simple changing the zoom of the map from 4 to 2.

I had some problems with my datapack and i would like to know if you can help me.

1 - My map for some reason don't locate the closest structure.

2 - If i'm at x = 50000 and z = 4000 for example the map will still locate the closest structure from spawn. ( That is a problem in your datapack too).



Just another thing, why don't you get rid of the "search_radius" like that i guess you will not have the problem of the map come blank.
1
09/27/2021 2:43 pmhistory
Level 15 : Journeyman Explorer
BarryMeyers
BarryMeyers avatar
Both questions are due to the way exploration maps are generated. The game would begin to generate the world in a spiral, starting from the spawn, gradually increasing the radius until the specific structure is found. Then, the game would generate the map. That is why the maps always generate the closest structure from spawn, rather than from the player. For my data pack, this is not an issue, as the intention is to sell maps to unexplored areas, rather than searching for nearby structures. I hope this explanation helps. It is very inefficient, in my opinion, compared to the /locate command, which just looks for the coordinates of the structures.

Nonetheless, you are lucky that I still saved the data pack files for my scrapped triangulation function. In testing, it managed to successfully locate the nearest ruined portal nearly instantly. However, it cannot be used to generate a map, because the exploration map generation is independent. Nonetheless, you can use this function with a compass to lead players to nearby ruined portals, which was what I did before scrapping the function. If this function satisfies your needs, feel free to message me and I will give you my scrapped function.

As for your optimisation suggestions, I will implement them right now and credit you. Thank you for the suggestions. :)
1
09/27/2021 8:25 pm
Level 11 : Journeyman Miner
CerbonXD
CerbonXD avatar
You're welcome. I would like to see this triangulation function, if you can send me would be good.
1
09/16/2021 4:26 pmhistory
Level 70 : Legendary Button Pusher
McMeddon
McMeddon avatar
this is awesome!
2
09/16/2021 5:56 pm
Level 15 : Journeyman Explorer
BarryMeyers
BarryMeyers avatar
I am glad that you enjoy it. Any comments on it? You can expect the full completed data pack by the end of this weekend.
1
09/17/2021 4:05 amhistory
Level 70 : Legendary Button Pusher
McMeddon
McMeddon avatar
nothing to add to :D just a really awesome idea - looking forward to test it
2
09/20/2021 3:48 am
Level 15 : Journeyman Explorer
BarryMeyers
BarryMeyers avatar
Feel free to give me feedback. I appreciate it! I assume that you will play with it in your private single-player world? It should be multiplayer compatible, in theory.
Planet Minecraft

Website

© 2010 - 2021
www.planetminecraft.com

Welcome