Once again, I'm up to something advanced: In my map, I want to include a fast travelling system. Since the distance between warp points will likely be larger than the render distance (thus setting any blocks next to one warp point with a command launched at another loading point won't work because all out-of-render-distance blocks are "outside of the world"), I thought a book with JSON-formatted text that warps you around is most likely to work.
The problem is that, as in a typical fast travelling system, players shall only be able to warp to warp points they already visited. That means, when a player reaches a warp point, that player should be able to perform some action that adds in the JSON-formatted text in his/her book dynamically. That wouldn't be a problem, if it weren't for the existing text in the book...
I decided to dedicate a whole page for each warp point, mainly because I thought pages should be easier to keep separate. If someone has a solution that only works on a smaller scope for whatever reason, feel free to post that too. Basically, what I need to do is add new text (with click event) to a written book, without overwriting the text that's already there.
I know I could restrict where the players can go, so that I know in advance what text the book already has. That would be against the concept of the map though, because it's meant to be 100% nonlinear (which is why I want a fast travelling system in first place). The option to call different commands based on what content the book already has also came to my mind, but was quickly rejected because I would need to go through every possible combination of active and inactive pages, so the contraptions would grow exponentially with the number of warp points. Separate books for each warp point would be somewhat of an option, but it's only a last resort because it obviously takes up lots of inventory space.
I would prefer the solution to be compatible with 1.8, but if there's really no way without walking into above flaws, I can also resort to a later version. Mods are OK (preferably Forge compatible) as long as the map is playable in Vanilla afterwards.