Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- command /enchant:
- trigger:
- if player is holding a pickaxe:
- open virtual chest inventory with size 3 named "&6Enchants Page" to player
- make gui slot 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 17, 18, 19, 20, 21, 22, 23, 24, 25, and 26 of player with light gray glass named " " to do nothing
- make gui slot 10 of player with sponge named "&cLucky Enchant" with lore "&7Chance to get lucky and get extra tokens while mining||&710000 Tokens||&6Max Level » 100" to run function Luck(player)
- make gui slot 11 of player with emerald named "&cFortune Enchant" with lore "&7Get more ores while mining blocks||&75000 Tokens||&6Max Level » 300" to run function Fortune(player)
- make gui slot 12 of player with gold_pickaxe named "&cEfficiency Enchant" with lore "&7While mining ores you will mine faster||&73000 Tokens||&6Max Level » 50" to run function Efficiency(player)
- make gui slot 13 of player with chest named "&cTreasure Enchant" with lore "&7Chance to get shards while mining that give rewards||&75000 Tokens||&6Max Level » 100" to run function Treasure(player)
- make gui slot 14 of player with magma_cream named "&cToken Enchant" with lore "&7Get bonus tokens while mining blocks||&77500 Tokens||&6Max Level » 100" to run function Token(player)
- make gui slot 15 of player with dandelion_yellow named "&cHaste Enchant" with lore "&7Chance to get haste while mining for a short peroid of time||&76000 Tokens||&6Max Level » 100" to run function Haste(player)
- make gui slot 16 of player with paper named "&cMerchant Enchant" with lore "&7Chance to sell your inventory while mining||&715000||&6&6Max Level » 250" to run function Merchant(player)
- function Merchant(p: player):
- if {tokens::%{_p}%} >= 15000:
- if lore of {_p}'s held item contains "&7Merchant":
- set {_lore::*} to lore of {_p}'s tool split at "||"
- loop {_lore::*}:
- if "%loop-value%" contains "&7Merchant":
- set {_value} to uncolored loop-value
- stop loop
- replace all "Merchant" with "" in {_value}
- replace all " " with "" in {_value}
- set {_value} to "%{_value}%" parsed as integer
- if {_value} is 250:
- send "&cYour Merchant Is Maxed Out" to {_p}
- close {_p}'s inventory
- stop
- replace all "&7Merchant %{_value}%" with "&7Merchant %{_value} +1%" in lore of {_p}'s tool
- remove 15000 from {tokens::%{_p}%}
- send "&3&lEnchants &8| &7You purchased &3Merchant &7enchant for &325000 Tokens&7." to {_p}
- else:
- set {_amount} to 15000 - {tokens::%{_p}%}
- send "&3&lEnchants &8| &7You need &b%{_amount}% Tokens &7more to buy this enchant" to {_p}
- close {_p}'s inventory
- function Luck(p: player):
- if {tokens::%{_p}%} >= 10000:
- if lore of {_p}'s held item contains "&7Luck":
- set {_lore::*} to lore of {_p}'s tool split at "||"
- loop {_lore::*}:
- if "%loop-value%" contains "&7Luck":
- set {_value} to uncolored loop-value
- stop loop
- replace all "Luck" with "" in {_value}
- replace all " " with "" in {_value}
- set {_value} to "%{_value}%" parsed as integer
- if {_value} is 100:
- send "&cYour Luck Is Maxed Out" to {_p}
- close {_p}'s inventory
- stop
- replace all "&7Luck %{_value}%" with "&7Luck %{_value} +1%" in lore of {_p}'s tool
- remove 10000 from {tokens::%{_p}%}
- send "&3&lEnchants &8| &7You purchased &3Luck &7enchant for &325000 Tokens&7." to {_p}
- else:
- set {_amount} to 10000 - {tokens::%{_p}%}
- send "&3&lEnchants &8| &7You need &b%{_amount}% Tokens &7more to buy this enchant" to {_p}
- close {_p}'s inventory
- function Treasure(p: player):
- if {tokens::%{_p}%} >= 5000:
- if lore of {_p}'s held item contains "&7Treasure":
- set {_lore::*} to lore of {_p}'s tool split at "||"
- loop {_lore::*}:
- if "%loop-value%" contains "&7Treasure":
- set {_value} to uncolored loop-value
- stop loop
- replace all "Treasure" with "" in {_value}
- replace all " " with "" in {_value}
- set {_value} to "%{_value}%" parsed as integer
- if {_value} is 100:
- send "&cYour Treasure Is Maxed Out" to {_p}
- close {_p}'s inventory
- stop
- replace all "&7Treasure %{_value}%" with "&7Treasure %{_value} +1%" in lore of {_p}'s tool
- remove 5000 from {tokens::%{_p}%}
- send "&3&lEnchants &8| &7You purchased &3Treasure &7enchant for &375000 Tokens&7." to {_p}
- else:
- set {_amount} to 5000 - {tokens::%{_p}%}
- send "&3&lEnchants &8| &7You need &b%{_amount}% Tokens &7more to buy this enchant" to {_p}
- close {_p}'s inventory
- function Token(p: player):
- if {tokens::%{_p}%} >= 7500:
- if lore of {_p}'s held item contains "&7Token":
- set {_lore::*} to lore of {_p}'s tool split at "||"
- loop {_lore::*}:
- if "%loop-value%" contains "&7Token":
- set {_value} to uncolored loop-value
- stop loop
- replace all "Token" with "" in {_value}
- replace all " " with "" in {_value}
- set {_value} to "%{_value}%" parsed as integer
- if {_value} is 100:
- send "&cYour Token Is Maxed Out" to {_p}
- close {_p}'s inventory
- stop
- replace all "&7Token %{_value}%" with "&7Token %{_value} +1%" in lore of {_p}'s tool
- remove 7500 from {tokens::%{_p}%}
- send "&3&lEnchants &8| &7You purchased &3Token &7enchant for &335000 Tokens&7." to {_p}
- else:
- set {_amount} to 7500 - {tokens::%{_p}%}
- send "&3&lEnchants &8| &7You need &b%{_amount}% Tokens &7more to buy this enchant" to {_p}
- close {_p}'s inventory
- function Haste(p: player):
- if {tokens::%{_p}%} >= 6000:
- if lore of {_p}'s held item contains "&7Haste":
- set {_lore::*} to lore of {_p}'s tool split at "||"
- loop {_lore::*}:
- if "%loop-value%" contains "&7Haste":
- set {_value} to uncolored loop-value
- stop loop
- replace all "Haste" with "" in {_value}
- replace all " " with "" in {_value}
- set {_value} to "%{_value}%" parsed as integer
- if {_value} is 100:
- send "&cYour Token Is Maxed Out" to {_p}
- close {_p}'s inventory
- stop
- replace all "&7Haste %{_value}%" with "&7Haste %{_value} +1%" in lore of {_p}'s tool
- remove 6000 from {tokens::%{_p}%}
- send "&3&lEnchants &8| &7You purchased &3Haste &7enchant for &340000 Tokens&7." to {_p}
- else:
- set {_amount} to 6000 - {tokens::%{_p}%}
- send "&3&lEnchants &8| &7You need &b%{_amount}% Tokens &7more to buy this enchant" to {_p}
- close {_p}'s inventory
- function Efficiency(p: player):
- if {tokens::%{_p}%} is greater than or equal to 3000:
- if level of efficiency of {_p}'s held item <= 49:
- send "&3&lEnchants &8| &7You purchased &3Efficiency &7enchant for &315000 Tokens&7." to {_p}
- remove 3000 from {tokens::%{_p}%}
- enchant the tool of {_p} with "efficiency %level of efficiency of {_p}'s tool +1%" parsed as enchantment type
- stop
- else:
- send "&cYour Efficiency Is Maxed Out" to {_p}
- close {_p}'s inventory
- else:
- set {_amount} to 3000 - {tokens::%{_p}%}
- send "&3&lEnchants &8| &7You need &b%{_amount}% Tokens &7more to buy this enchant" to {_p}
- close {_p}'s inventory
- stop
- function Fortune(p: player):
- if {tokens::%{_p}%} is greater than or equal to 5000:
- if level of fortune of {_p}'s held item <= 299:
- send "&3&lEnchants &8| &7You purchased &3Fortune &7enchant for &330000 Tokens&7." to {_p}
- remove 5000 from {tokens::%{_p}%}
- enchant the tool of {_p} with "fortune %level of fortune of {_p}'s tool +1%" parsed as enchantment type
- stop
- else:
- send "&cYour Fortune Is Maxed Out" to {_p}
- close {_p}'s inventory
- else:
- set {_amount} to 5000 - {tokens::%{_p}%}
- send "&3&lEnchants &8| &7You need &b%{_amount}% Tokens &7more to buy this enchant" to {_p}
- close {_p}'s inventory
- on mine:
- if lore of player's held item contains "&7Luck":
- set {_lore::*} to lore of player's tool split at "||"
- loop {_lore::*}:
- if "%loop-value%" contains "&7Luck":
- set {_value} to uncolored loop-value
- stop loop
- replace all "Luck" with "" in {_value}
- replace all " " with "" in {_value}
- set {_value} to "%{_value}%" parsed as integer
- set {_value} to {_value} /25
- chance of {_value}%:
- set {_tokens} to a random integer between 1 and 3000
- add {_tokens} to {tokens::%player%}
- send "&7You got lucky and recieved &a%{_tokens}% Tokens &7From your lucky enchant"
- on mine:
- if lore of player's held item contains "&7Treasure":
- set {_lore::*} to lore of player's tool split at "||"
- loop {_lore::*}:
- if "%loop-value%" contains "&7Treasure":
- set {_value} to uncolored loop-value
- stop loop
- replace all "Treasure" with "" in {_value}
- replace all " " with "" in {_value}
- set {_value} to "%{_value}%" parsed as integer
- set {_value} to {_value} /25
- chance of {_value}%:
- give player prismarine_shard named "&7&lSimple Shard"
- send player title "&d&lTREASURE" with subtitle "&7You got a &lSimple Shard"
- play "BLOCK_ANVIL_PLACE " to player
- on mine:
- if lore of player's held item contains "&7Haste":
- set {_lore::*} to lore of player's tool split at "||"
- loop {_lore::*}:
- if "%loop-value%" contains "&7Haste":
- set {_value} to uncolored loop-value
- stop loop
- replace all "Haste" with "" in {_value}
- replace all " " with "" in {_value}
- set {_value} to "%{_value}%" parsed as integer
- set {_value} to {_value} /25
- chance of {_value}%:
- apply haste 3 to the player for 5 seconds
- play "entity_player_levelup" to player
- on mine:
- if lore of player's held item contains "&7Merchant":
- set {_lore::*} to lore of player's tool split at "||"
- loop {_lore::*}:
- if "%loop-value%" contains "&7Merchant":
- set {_value} to uncolored loop-value
- stop loop
- replace all "Merchant" with "" in {_value}
- replace all " " with "" in {_value}
- set {_value} to "%{_value}%" parsed as integer
- set {_value} to {_value} /25
- chance of {_value}%:
- set {_ironWorth} to 0.74
- set {_ironCount} to amount of iron_ingot in player's inventory
- set {_ironSell} to {_ironCount} * {_ironWorth}
- set {_coalWorth} to 0.16
- set {_coalCount} to amount of coal in player's inventory
- set {_coalSell} to {_coalCount} * {_coalWorth}
- set {_goldWorth} to 1.72
- set {_goldCount} to amount of gold_ingot in player's inventory
- set {_goldSell} to {_goldCount} * {_goldWorth}
- set {_diamondWorth} to 5.32
- set {_diamondCount} to amount of diamond in player's inventory
- set {_diamondSell} to {_diamondCount} * {_diamondWorth}
- set {_emeraldWorth} to 12.56
- set {_emeraldCount} to amount of emerald in player's inventory
- set {_emeraldSell} to {_emeraldCount} * {_emeraldWorth}
- remove all emerald from player's inventory
- remove all diamond from player's inventory
- remove all gold_ingot from player's inventory
- remove all coal from player's inventory
- remove all iron ingot from player's inventory
- set {_totalCount} to {_coalCount} + {_ironCount} + {_goldCount} + {_diamondCount} + {_emeraldCount}
- set {_totalProfit} to {_ironSell} + {_coalSell} + {_goldSell} + {_diamondSell} + {_emeraldSell}
- set {_totalProfit} to {_totalProfit} * {booster::%player%}
- set {_totalBooster} to {_totalProfit} * {globalbooster}
- set {_afterSell} to {_totalProfit} + {_totalBooster}
- set action bar of player to coloured "&7Sold &a%{_totalCount}% &7Item(s) for &f$&a%{_aftersell}% &3&lPersonal &a&l(*%{booster::%player%}%) &3&lGlobal &a&l(*%{globalbooster}%)"
- add {_aftersell} to player's balance
- on mine:
- if lore of player's held item contains "&7Token":
- set {_lore::*} to lore of player's tool split at "||"
- loop {_lore::*}:
- if "%loop-value%" contains "&7Token":
- set {_value} to uncolored loop-value
- stop loop
- replace all "Token" with "" in {_value}
- replace all " " with "" in {_value}
- set {_value} to "%{_value}%" parsed as integer
- set {_value} to {_value} * 1.6
- set {_number} to a random integer between 1 and {_value}
- add {_number} to {tokens::%player%}
- else:
- set {_number} to a random integer between 1 and 5
- add {_number} to {tokens::%player%}
- on mine of coal ore:
- if {autoinv::%player%} is true:
- cancel drops
- if the player's tool is enchanted with fortune:
- set {_fortune} to random integer between 1 and level of fortune on player's tool
- give player {_fortune} of coal
- on mine of iron ore:
- if {autoinv::%player%} is true:
- cancel drops
- if the player's tool is enchanted with fortune:
- set {_fortune} to random integer between 1 and level of fortune on player's tool
- give player {_fortune} of iron ingot
- on mine:
- add 1 to {blocks::%player%}
Advertisement
Add Comment
Please, Sign In to add comment