I'v recently go into making a custom enchantment skript for my server, I have got to the part where revealing books chooses between a set ratio of numbers, but when right clicking any item it discovers an enchant, and not the book with the name that should be discovering it.
Here is the code:
Here is the code:
code_language.skript:
on rightclick:
if player's held item is book named "&fCommon Enchantment Book &7(Right Click)" with lore "&7Examine to recieve a random||&fCommon &7Enchantment Book.":
remove 1 book named "&fCommon Enchantment Book &7(Right Click)" with lore "&7Examine to recieve a random||&fCommon &7Enchantment Book." from player
launch flickering trailing burst firework colored white at player timed 1
chance of 100%
set {common} to a random integer between 1 and 1
if {common} is 1:
give player 1 book named "Will edit later"
stop
on rightclick:
if player's held item is book named "&bRare Enchantment Book &7(Right Click)" with lore "&7Examine to recieve a random||&bRare &7Enchantment Book.":
remove 1 book named "&bRare Enchantment Book &7(Right Click)" with lore "&7Examine to recieve a random||&bRare &7Enchantment Book." from player
launch flickering trailing burst firework colored white at player timed 1
set {rare} to a random integer between 1 and 1
if {rare} is 1:
give player 1 book named "Will edit later 2"
stop
on rightclick:
if player's held item is book named "&6Legendary Enchantment Book &7(Right Click)" with lore "&7Examine to recieve a random||&6Legendary &7Enchantment Book.":
remove 1 book named "&6Legendary Enchantment Book &7(Right Click)" with lore "&7Examine to recieve a random||&6Legendary &7Enchantment Book." from player
launch flickering trailing burst firework colored white at player timed 1
set {legendary} to a random integer between 1 and 1
if {legendary} is 1:
give player 1 book named "Will edit later 3"
stop