Command to open book with json text

  • 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.

GamingGeek

Supporter
Aug 1, 2017
46
0
0
21
Hi, I don't know whether this would be possible with Skript or not but I'm looking to recreate Hypixel's /nick feature. I want to have the command /nick open a book with text and when you click on a rank, it runs a command. I currently have this to open the book but it just says invalid book tag...

code_language.skript:
command /openBook:
    trigger:
        set {_item} to slot player's current hotbar slot of player
        set slot player's current hotbar slot of player to a written book
        open book player's tool to player
        set slot player's current hotbar slot of player to {_item}

Here is what I'm trying to achieve:
upload_2017-7-20_19-11-15-png.261735
 
Syntax:
code_language.skript:
#Expressions:
 
    #Grab a new written book (Because Skript's is different)
    [a] new [written] book
 
#TextComponent stuff
 
    #Create a new text component
    [a] [new] text component [with [text]] %strings%
 
    #Add hover event stuff to the text component (When a player hovers their mouse over it)
    add hover event with action %hovereventaction% (and|with) [(value|text)] %string% to [text component] %textcomponent%
 
    #Add clickable event stuff to the text component (When a player clicks the text)
    add click event with action %clickeventaction% (and|with|to) [(execute|text|link)]  %string% to [text component] %textcomponent%
 
    #Add a page with the text component to a book
    add text component %textcomponent% to [book] %itemstack%
 
    #Message the json text component (tellraw) to the player
    message text component %textcomponent% to %players%
 
    #Works from 1.8-1.12 as tested
 
Status
Not open for further replies.