Saving an interactive book in Skript-YAML

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.
Apr 22, 2020
48
4
8
Trying to save the book the player has in their hand WITH clickable events and command in Skript-YAML. Don't know if it's possible but here is the code:

Code:
set yaml value "book_%arg 2%" from "books" to player's tool

Also tried setting a variable to the player's tool and then storing that in yaml to no avail. Does this need to be parsed? I'm new to skript and any help is appreciated.

Edit: Skellet no longer supports books from what it looks like and I'm running paper 1.15.2
 
Last edited:
Hello, this should work.
Do you save the YML after?
Yes it saves to this:
Code:
book_Nick1:
    ==: org.bukkit.inventory.ItemStack
    v: 2230
    type: WRITTEN_BOOK
    meta:
        ==: ItemMeta
        meta-type: BOOK_SIGNED
        title: Nickname
        author: Eringale
        pages:
        - |-
            Let's get you set up§0
            §0With your nickname! First, you'll need to choose which §0§lRANK§0
            §0you would like to be shows as when nicked.§0
            §0
            §0➤ §0Default§0
            §0➤ §dHERO§0
            §0➤ §bCHAMPION§0
            §0➤ §6LEGEND

These last 4 items should have clickable events (Nickname skript) that activate commands. If anyone even knows the proper way for me to manually type it into the yaml PLEASE let me know.
[doublepost=1588604660,1588604382][/doublepost]Update 2:
Tried using SKBee. Reloaded with 0 errors but does not store the nbt still. Maybe my syntax is off?


Code:
              if player is holding a written book:
                set {_book} to player's tool
                set {_nbt} to nbt of player's tool
                add {_nbt} to {_book}
                set yaml value "book_%arg 2%" from "books" to {_book}
                save yaml "books"
                message "{@prefix} Book &e%arg 2%&7 has been successfully set!" to executor
 
Status
Not open for further replies.