Files
ksiegi.sk
README.txt
Code
2 166
ksiegi.sk
# Custom Books GUI System
# Author: Generated by Kodari
# Version: 1.0
# Skript: 2.15.3
# MC Version: 1.21.1
options:
prefix: &6[Księgi]&r
gui-title: &6&lCustom Books
gui-rows: 3
# Command to open the books GUI
command /ksiegi:
permission: ksiegi.use
permission message: &cYou don't have permission to use this!
trigger:
openBooksGUI(player)
# Function to create and open the GUI
function openBooksGUI(p: player):
# Create the inventory
open chest inventory with 3 rows named "{@gui-title}" to {_p}
wait 1 tick
# Fill borders with glass panes
loop integers from 0 to 26:
if loop-value is 0, 1, 2, 6, 7, 8, 9, 17, 18, 19, 20, 24, 25 or 26:
set slot loop-value of {_p}'s current inventory to light gray stained glass pane named " "
# Info book (slot 4)
set {_info} to book named "&e&lCustom Books" with lore "&7Click any book to claim it!" and "&7Books never disappear!" and "" and "&6Available: 9 unique books"
set slot 4 of {_p}'s current inventory to {_info}
# Book 1: Web I (Cobweb) - for boots
set {_book1} to enchanted book of cobweb 1 named "&b&lWeb I" with lore "&7Apply to boots" and "&7Creates cobwebs under you" and "" and "&aClick to claim!"
set slot 10 of {_p}'s current inventory to {_book1}
# Book 2: Sharpness VI
set {_book2} to enchanted book of sharpness 6 named "&c&lSharpness VI" with lore "&7Apply to swords/axes" and "&7+7.5 attack damage" and "" and "&aClick to claim!"
set slot 11 of {_p}'s current inventory to {_book2}
# Book 3: Protection V
set {_book3} to enchanted book of protection 5 named "&9&lProtection V" with lore "&7Apply to armor" and "&7Enhanced damage reduction" and "" and "&aClick to claim!"
set slot 12 of {_p}'s current inventory to {_book3}
# Book 4: Fortune IV
set {_book4} to enchanted book of fortune 4 named "&e&lFortune IV" with lore "&7Apply to pickaxe" and "&7Increased drop rates" and "" and "&aClick to claim!"
set slot 13 of {_p}'s current inventory to {_book4}
# Book 5: Efficiency VI
set {_book5} to enchanted book of efficiency 6 named "&6&lEfficiency VI" with lore "&7Apply to tools" and "&7Super fast mining" and "" and "&aClick to claim!"
set slot 14 of {_p}'s current inventory to {_book5}
# Book 6: Unbreaking IV
set {_book6} to enchanted book of unbreaking 4 named "&d&lUnbreaking IV" with lore "&7Apply to any item" and "&7Extreme durability" and "" and "&aClick to claim!"
set slot 15 of {_p}'s current inventory to {_book6}
# Book 7: Feather Falling V
set {_book7} to enchanted book of feather falling 5 named "&f&lFeather Falling V" with lore "&7Apply to boots" and "&7No fall damage" and "" and "&aClick to claim!"
set slot 16 of {_p}'s current inventory to {_book7}
# Book 8: Looting IV
set {_book8} to enchanted book of looting 4 named "&a&lLooting IV" with lore "&7Apply to swords" and "&7More mob drops" and "" and "&aClick to claim!"
set slot 21 of {_p}'s current inventory to {_book8}
# Book 9: Mending (Special)
set {_book9} to enchanted book of mending 1 named "&5&lMending ∞" with lore "&7Apply to any item" and "&7XP repairs items" and "&d&lSpecial Edition" and "" and "&aClick to claim!"
set slot 22 of {_p}'s current inventory to {_book9}
# Handle clicks in the GUI
on inventory click:
if name of player's current inventory is "{@gui-title}":
cancel event
# Check if clicked item is an enchanted book
if clicked item is an enchanted book:
# Give the book to player
give clicked item to player
play sound "entity.player.levelup" with volume 0.5 to player
send "{@prefix} &aYou claimed: %name of clicked item%&a!" to player
# Book stays in GUI - no need to refresh
# On script load
on script load:
send "{@prefix} &aCustom Books GUI loaded successfully! (v2.15.3)" to console
send "&7Command: /ksiegi" to console