So i have this custom enchants skript i made and i wonder if there is a way to clean it up and make an enchant that allow you to mine in a 3x3 and a 4x4 "miner 1 for 3x3 and Miner 2 for 4x4" Thank you!
(I am a begginer skripter so i am not good at this stuff)
command /customenchants:
permission: op
permission message: "&c&lHey! &7&lyou cant use this command"
trigger:
set {_gui} to a new chest inventory with 1 row with name "&7&lCustom Enchants"
set slot 0 of {_gui} to nether star with name "&1&lPickaxe &7&lEnchants"
open {_gui} to player
on inventory click:
if name of event-inventory is "&7&lCustom Enchants":
if index of event-slot = 0:
set {_gui} to a new chest inventory with 1 row with name "&1&lPickaxe &7&lEnchants"
set slot 0 of {_gui} to nether star with name "&4&lExplosive"
set slot 1 of {_gui} to nether star with name "&3&lMiner"
open {_gui} to player
on inventory click:
if name of event-inventory is "&1&lPickaxe &7&lEnchants":
if index of event-slot = 0:
set {_gui} to a new chest inventory with 1 row with name "&4&lExplosive &7&lEnchantments"
set slot 0 of {_gui} to nether star with name "&c&lExplosive &7&lI"
set slot 1 of {_gui} to nether star with name "&c&lExplosive &7&lII"
set slot 2 of {_gui} to nether star with name "&c&lExplosive &7&lIII" with lore "&cWARNING &7this is very explosive"
open {_gui} to player
else:
if index of event-slot = 1:
set {_gui} to a new chest inventory with 1 row with name "&3&lMiner &7&lEnchantments"
set slot 0 of {_gui} to nether star with name "&3&lMiner &7&lI"
set slot 1 of {_gui} to nether star with name "&3&lMiner &7&lII"
open {_gui} to player
on inventory click:
if name of event-inventory is "&3&lMiner &7&lEnchantments":
if index of event-slot = 0:
cancel event
send "&c&lHey! &7&lThis has not been coded yet"
else:
if index of event-slot = 1:
cancel event
send "&c&lHey! &7&lThis has not been coded yet"
on inventory click:
if name of event-inventory is "&4&lExplosive &7&lEnchantments":
if index of event-slot = 0:
if held item isn't pickaxe:
cancel event
send "&c&lHey! &7&lYou can't enchant that item with &c&lExplosive &7&lI"
else:
cancel event
set lore of held item to "&c&lExplosive &7&lI"
send "&2&lSuccess! &7&lYou have added the enchant &c&lExplosive &7&lI &7<o your pickaxe!"
else:
if index of event-slot = 1:
if held item isn't pickaxe:
cancel event
send "&c&lHey! &7&lYou can't enchant that item with &c&lExplosive &7&lII"
else:
cancel event
set lore of held item to "&c&lExplosive &7&lII"
send "&2&lSuccess! &7&lYou have added the enchant &c&lExplosive &7&lII &7<o your pickaxe!"
else:
if index of event-slot = 2:
if held item isn't pickaxe:
cancel event
send "&c&lHey! &7&lYou can't enchant that item with &c&lExplosive &7&lIII"
else:
cancel event
set lore of held item to "&c&lExplosive &7&lII"
send "&2&lSuccess! &7&lYou have added the enchant &c&lExplosive &7&lIII &7<o your pickaxe!"
on mine:
if lore of held item is "&c&lExplosive &7&lI":
chance of 10%
apply potion of resistance of tier 10 to player for 0.5 seconds
create explosion of force 5 at event-block
on mine:
if lore of held item is "&c&lExplosive &7&lII":
chance of 10%
apply potion of resistance of tier 10 to player for 0.5 seconds
create explosion of force 10 at event-block
on mine:
if lore of held item is "&c&lExplosive &7&lIII":
chance of 10%
apply potion of resistance of tier 10 to player for 0.5 seconds
create explosion of force 15 at event-block
(I am a begginer skripter so i am not good at this stuff)
command /customenchants:
permission: op
permission message: "&c&lHey! &7&lyou cant use this command"
trigger:
set {_gui} to a new chest inventory with 1 row with name "&7&lCustom Enchants"
set slot 0 of {_gui} to nether star with name "&1&lPickaxe &7&lEnchants"
open {_gui} to player
on inventory click:
if name of event-inventory is "&7&lCustom Enchants":
if index of event-slot = 0:
set {_gui} to a new chest inventory with 1 row with name "&1&lPickaxe &7&lEnchants"
set slot 0 of {_gui} to nether star with name "&4&lExplosive"
set slot 1 of {_gui} to nether star with name "&3&lMiner"
open {_gui} to player
on inventory click:
if name of event-inventory is "&1&lPickaxe &7&lEnchants":
if index of event-slot = 0:
set {_gui} to a new chest inventory with 1 row with name "&4&lExplosive &7&lEnchantments"
set slot 0 of {_gui} to nether star with name "&c&lExplosive &7&lI"
set slot 1 of {_gui} to nether star with name "&c&lExplosive &7&lII"
set slot 2 of {_gui} to nether star with name "&c&lExplosive &7&lIII" with lore "&cWARNING &7this is very explosive"
open {_gui} to player
else:
if index of event-slot = 1:
set {_gui} to a new chest inventory with 1 row with name "&3&lMiner &7&lEnchantments"
set slot 0 of {_gui} to nether star with name "&3&lMiner &7&lI"
set slot 1 of {_gui} to nether star with name "&3&lMiner &7&lII"
open {_gui} to player
on inventory click:
if name of event-inventory is "&3&lMiner &7&lEnchantments":
if index of event-slot = 0:
cancel event
send "&c&lHey! &7&lThis has not been coded yet"
else:
if index of event-slot = 1:
cancel event
send "&c&lHey! &7&lThis has not been coded yet"
on inventory click:
if name of event-inventory is "&4&lExplosive &7&lEnchantments":
if index of event-slot = 0:
if held item isn't pickaxe:
cancel event
send "&c&lHey! &7&lYou can't enchant that item with &c&lExplosive &7&lI"
else:
cancel event
set lore of held item to "&c&lExplosive &7&lI"
send "&2&lSuccess! &7&lYou have added the enchant &c&lExplosive &7&lI &7<o your pickaxe!"
else:
if index of event-slot = 1:
if held item isn't pickaxe:
cancel event
send "&c&lHey! &7&lYou can't enchant that item with &c&lExplosive &7&lII"
else:
cancel event
set lore of held item to "&c&lExplosive &7&lII"
send "&2&lSuccess! &7&lYou have added the enchant &c&lExplosive &7&lII &7<o your pickaxe!"
else:
if index of event-slot = 2:
if held item isn't pickaxe:
cancel event
send "&c&lHey! &7&lYou can't enchant that item with &c&lExplosive &7&lIII"
else:
cancel event
set lore of held item to "&c&lExplosive &7&lII"
send "&2&lSuccess! &7&lYou have added the enchant &c&lExplosive &7&lIII &7<o your pickaxe!"
on mine:
if lore of held item is "&c&lExplosive &7&lI":
chance of 10%
apply potion of resistance of tier 10 to player for 0.5 seconds
create explosion of force 5 at event-block
on mine:
if lore of held item is "&c&lExplosive &7&lII":
chance of 10%
apply potion of resistance of tier 10 to player for 0.5 seconds
create explosion of force 10 at event-block
on mine:
if lore of held item is "&c&lExplosive &7&lIII":
chance of 10%
apply potion of resistance of tier 10 to player for 0.5 seconds
create explosion of force 15 at event-block