Hi I tried to make a custom pickaxe enchantment but it just doesn't work. there are no errors. And i can open the gui and buy the enchant but the enchant doesn't lore and doesn't work. If anyone knows a fix i would be so happy cuz ive been trying for days
function openEnchantsMenu(p: player):
set metadata tag "enchantsMenu" of {_p} to chest inventory with 3 rows named "Custom Enchantments"
set slot (integers between 1 and 26) of metadata tag "enchantsMenu" of {_p} to gray stained glass pane
set slot 11 of metadata tag "enchantsMenu" of {_p} to tnt named "&cExplosive Enchant" with lore "&bCost: &2$10,000"
open (metadata tag "enchantsMenu" of {_p}) to {_p}
on right click:
openEnchantsMenu(player) if tool is any pickaxe
on inventory click:
if player's current inventory = (metadata tag "enchantsMenu" of player):
cancel event
if name of event-slot is "&cExplosive Enchant":
if player's balance >= 10000:
set {_} to tag "ExplosiveEnchant" of nbt of tool ? 0
if {_} <= 1000:
set tag "ExplosiveEnchant" of nbt of tool to ({_} + 1)
send "&aYou bought +1 level of Explosion!"
else:
send "&cSorry, but you are at the max level!"
else:
send "&cYou dont have enough money to buy this enchantment!"
set line 1 of lore of tool to "&cExplosive"
on mine:
if tag "ExplosiveEnchant" of nbt of tool is set:
set {_} to tag "ExplosiveEnchant" of nbt of tool
set {_chance} to random integer between 1 and 1000
if {_chance} is between 1 and ({_} parsed as integer):
loop all blocks in radius 3 of event-block:
give loop-block to player
set loop-block to air
function openEnchantsMenu(p: player):
set metadata tag "enchantsMenu" of {_p} to chest inventory with 3 rows named "Custom Enchantments"
set slot (integers between 1 and 26) of metadata tag "enchantsMenu" of {_p} to gray stained glass pane
set slot 11 of metadata tag "enchantsMenu" of {_p} to tnt named "&cExplosive Enchant" with lore "&bCost: &2$10,000"
open (metadata tag "enchantsMenu" of {_p}) to {_p}
on right click:
openEnchantsMenu(player) if tool is any pickaxe
on inventory click:
if player's current inventory = (metadata tag "enchantsMenu" of player):
cancel event
if name of event-slot is "&cExplosive Enchant":
if player's balance >= 10000:
set {_} to tag "ExplosiveEnchant" of nbt of tool ? 0
if {_} <= 1000:
set tag "ExplosiveEnchant" of nbt of tool to ({_} + 1)
send "&aYou bought +1 level of Explosion!"
else:
send "&cSorry, but you are at the max level!"
else:
send "&cYou dont have enough money to buy this enchantment!"
set line 1 of lore of tool to "&cExplosive"
on mine:
if tag "ExplosiveEnchant" of nbt of tool is set:
set {_} to tag "ExplosiveEnchant" of nbt of tool
set {_chance} to random integer between 1 and 1000
if {_chance} is between 1 and ({_} parsed as integer):
loop all blocks in radius 3 of event-block:
give loop-block to player
set loop-block to air
Last edited: