Guidebook

Guidebook

6M Downloads

can't spawn a textbook

PSILONCRAFT opened this issue · 23 comments

commented

when i user the /give @p gbook:guidebook 1 0 {Book:"gbook:xml/test.xml"}

i get a book but i get the an unknown error occur

I have the following file setup

/config/books in there there are the folder books and books.json with the entry
[ «gbook:books/rules.xml», «gbook:books/demobook.xml», «gbook:books/test.xml» ]

what is wrong here

commented

your give command says "xml/test.xml", but your books.json has "books/test.xml" ;P

note that you don't need a books.json for books placed inside config/books, they are available without one.

commented

/give @p gbook:guidebook 1 0 {Book:"books/test.xml"} still gives an error i get a book but can't open it

commented

try to use just "test.xml", if you say "books/test.xml" it will search for the book in "config/books/books/test.xml" :P

commented

tried /give @p gbook:guidebook 1 0 {gbook:"/test.xml"} stil get a book but can't open it

commented

I have a folder inside configs that i called books and in there there are a new folder named books that have the xml files

commented

Oh I see your issue! It's meant to be: /give @p gbook:guidebook 1 0 {Book:"test.xml"}

commented

If you have a second books folder inside, then "books/test.xml" instead

commented

Wait no, I'm tired, sorry: /give @p gbook:guidebook 1 0 {Book:"gbook:books/test.xml"}

commented

is there something wring with the json file

[ "gbook:books/demobook.xml","gbook:books/rules.xml", "gbook:books/test.xml" ]

commented

You don't need that books.json file at all. Not in the config folder.

commented

hm still have issues can't open the books. restarting the server

commented

Deleted the books.json from config/books

commented

Wait, you just mentioned a server. Are you trying to put the books in the server? That won't work. There's nothing in the mod for sending books from the server to the client -- they have to be provided in the clients already, for them to work at all.

commented

ok so I have to distribute them to the client for it to work

commented

ok that makes more sense. thanks for helping out man. Nice work on the mod thanks a lot

commented

Yep. Sorry for the confusion.

I could possibly implement a system where the book data is transferred from the server to the client, but even in that case, it would only be xml data, images have to be available during launch.

commented

spoke to soon here sorry. added it to the config at the client and i stil can't open the book after it popps in the toolbar

commented

I'm running this xml file

<include ref="gbook:xml/standard.xml" />

<chapter>
    <page>
        <p>Left</p>
        <p align="center">Center</p>
        <p align="right">Right</p>
        <title>Title</title>
        <p bold="true">Bold</p>
        <p italics="true">Italics</p>
        <p underline="true">Underline</p>
        <p color="#306090">Colored</p>
        <p bold="true" italics="true" underline="true" color="#123456" align="center">All the Formats</p>
        <apace height="20" />
        <p space="20">A</p>
        <p>B</p>
        <space height="25%" />
        <p>C</p>
        <p indent="60">D</p>
    </page>
    <page>
        <p>Page 2</p>
        <link ref="chapter2">Click me</link>
    </page>
</chapter>
<chapter id="chapter2">
    <page>
        <title>Chapter 2</title>

        <big_recipe>
            <stack item="minecraft:iron_ingot"/>
            <stack item="minecraft:iron_ingot"/>
            <stack item="minecraft:iron_ingot"/>
            <space/>
            <stack item="minecraft:stick"/>
            <space/>
            <space/>
            <stack item="minecraft:stick"/>
            <space/>
            <stack item="minecraft:iron_pickaxe"/>
        </big_recipe>

        <small_recipe>
            <stack item="minecraft:quartz"/>
            <stack item="minecraft:quartz"/>
            <stack item="minecraft:quartz"/>
            <stack item="minecraft:quartz"/>
            <stack item="minecraft:quartz_block"/>
        </small_recipe>
    </page>
</chapter>
commented

That is not a valid book file.

You want it to look like:

<book>
    <chapter>
        <page>
            <p>Test</p>
        </page>
    </chapter>
</book>

As you can see, the top-level tag has to be <book>.

commented

Nice here we go. working now thanks a lot mate

commented

Is there live update when i edit the book or do i need to restart the game for every change. Is there a refresh command for the xml files??

commented

F3+T will reload all resources, including books.

commented

ok thanks