CanaryModTeam / CanaryLib

The CanaryMod API Library
http://canarymod.net
28 stars 22 forks source link

API for Fake Book GUI #73

Closed clucky closed 9 years ago

clucky commented 9 years ago

I do not know if this would be possible to do, but it would be useful for me to display the book GUI on a player's screen with pre-programmed wording within it. I plan to use this for a command handbook (openable via command); as well as for a questing journal, which would update as a player completes stages in a quest. If you have ever played the MMORPG, Runescape, then you know what I am referring to when I mention the questing journal.

This would be possible by allowing developers to use the Canary API to fake the book GUI. The argument for the text in the book would more than likely be a String for a single paragraph, or a String[] for multiple paragraphs, each element within the String[] array would be its own paragraph, separated by a newline. Although I'm not certain how, it would probably be best if Canary were to handle the wrapping of words, this way words aren't split-up when displayed on the book GUI. It would probably also be a good idea to parse newline (\n), as well as chat formatting.

clucky commented 9 years ago

What was the conclusion @darkdiplomat?

darkdiplomat commented 9 years ago

You can dynamically create books using the BookHelper API and pass that dynamically generated book into the openBook method. Minecraft will only accept an already written book though, so make sure the type is of WrittenBook