Files
axe-twist.sk
Code
1 585
axe-twist.sk
options:
prefix: &c&lAxeSMP &7»
max-energy: 5
min-energy: -5
on pickup totem of undying:
if player's gamemode is creative or spectator:
stop
set {_totem} to the amount of totem of undying in player's inventory
set {_maxTotems} to max(1, {energy.%player%})
if {_totem} >= {_maxTotems}:
cancel event
on load:
set {axesmp::energy} to an nether star named "<##64BEE9>⚡ <##7DCBF0>&lE<##89D1F3>&lN<##95D7F6>&lE<##A2DEFA>&lR<##AEE4FD>&lG<##9FDCF9>&lY <##82CDF1>⚡" with lore "<##64BEE9>Energy powers your axe heart and unlocks" and "<##64BEE9>stronger abilities. Max: 5 energy." and "&7Right-click to deposit." and "" and "<##64BEE9>⚔ Kill players to gain energy!" and "<##64BEE9>☠ Die to lose energy!"
set {axesmp::reroller} to an nether star named "<##F13A3A>🔄 <##F44444>A<##F54949>X<##F64D4D>E <##F75252>R<##F95757>E<##FA5C5C>R<##F95656>O<##F75151>L<##F44545>L<##F44040>E<##F13A3A>R <##F13A3A>🔄" with lore "<##F13A3A>Reroll your current axe heart for a new one!" and "<##F13A3A>All hearts have equal chances. Good luck!" and "&7" and "&7Right-click to use" and "" and "&c⚠ Do not spam click!"
register new shaped recipe for {axesmp::reroller} using diamond block, enchanted golden apple, diamond block, netherite ingot, {axesmp::energy}, netherite ingot, diamond block, enchanted golden apple and diamond block with id "axe_reroller"
send "{@prefix} &aAxe Twist System Loaded! &7v2.0" to console
command /axe:setenergy <offlineplayer> <number>:
aliases: /setenergy
permission: axesmp.admin
trigger:
if arg-2 is set:
if arg-2 >= {@min-energy}:
if arg-2 <= {@max-energy}:
set {energy.%arg-1%} to arg-2
send "{@prefix} &aSet %arg-1%'s energy to &e%arg-2% &7/ {@max-energy}" to player
send "{@prefix} &aYour energy was set to &e%arg-2% &7/ {@max-energy}" to arg-1
else:
send "{@prefix} &cMax energy is {@max-energy}!" to player
else:
send "{@prefix} &cMin energy is {@min-energy}!" to player
command /axe:setheart <offlineplayer> <text>:
aliases: /setheart
permission: axesmp.admin
trigger:
if arg-2 is set:
if arg-2 is "Frozen":
set {heart.%arg-1's uuid%} to "Frozen"
set arg-1's max health to 10
send "{@prefix} &bAdmin changed your heart to <##A3BDFF>Frozen Axe&b!" to arg-1
send "{@prefix} <##A3BDFF>Set %arg-1%'s heart to Frozen!" to player
else if arg-2 is "Berserker":
set {heart.%arg-1's uuid%} to "Berserker"
set arg-1's max health to 10
send "{@prefix} &bAdmin changed your heart to <##A30C13>Berserker Axe&b!" to arg-1
send "{@prefix} <##A30C13>Set %arg-1%'s heart to Berserker!" to player
else if arg-2 is "Thunder":
set {heart.%arg-1's uuid%} to "Thunder"
set arg-1's max health to 10
send "{@prefix} &bAdmin changed your heart to &eThunder Axe&b!" to arg-1
send "{@prefix} &eSet %arg-1%'s heart to Thunder!" to player
else if arg-2 is "Inferno":
set {heart.%arg-1's uuid%} to "Inferno"
set arg-1's max health to 10
send "{@prefix} &bAdmin changed your heart to <##FAC000>Inferno Axe&b!" to arg-1
send "{@prefix} <##FAC000>Set %arg-1%'s heart to Inferno!" to player
else if arg-2 is "Vitality":
set {heart.%arg-1's uuid%} to "Vitality"
set arg-1's max health to 10
send "{@prefix} &bAdmin changed your heart to <##EC51AF>Vitality Axe&b!" to arg-1
send "{@prefix} <##EC51AF>Set %arg-1%'s heart to Vitality!" to player
else:
send "{@prefix} &cInvalid heart! Use: Frozen, Berserker, Thunder, Inferno, Vitality" to player
on tab complete of "/axe:setheart":
set tab completions for position 2 to "Frozen", "Berserker", "Thunder", "Inferno" and "Vitality"
on tab complete of "/setheart":
set tab completions for position 2 to "Frozen", "Berserker", "Thunder", "Inferno" and "Vitality"
on join:
if player's gamemode is spectator or creative:
stop
if {energy.%player%} is not set:
set {energy.%player%} to 0
if {heart.%player%} is not set:
send title "" with subtitle "&fRolling your axe heart..." to player
wait 2 seconds
set {_roll} to a random integer between 1 and 5
if {_roll} is 1:
set {heart.%player%} to "Frozen"
send title "&0&l?" with subtitle "&fYou received the &7&k[][] &fheart!" to player
loop 30 times:
play sound "BLOCK.NOTE_BLOCK.PLING" to player
wait 2 ticks
send title "<##A3BDFF>&l❄" with subtitle "&fYou received the <##A3BDFF>&lFROZEN AXE &fHeart!" to player for 5 seconds
play sound "entity.generic.explode" with volume 1 to player
stop
if {_roll} is 2:
set {heart.%player%} to "Inferno"
send title "&0&l?" with subtitle "&fYou received the &7&k[][] &fheart!" to player
loop 30 times:
play sound "BLOCK.NOTE_BLOCK.PLING" to player
wait 2 ticks
send title "<##FAC000>&l🔥" with subtitle "&fYou received the <##FAC000>&lINFERNO AXE &fHeart!" to player for 5 seconds
play sound "entity.generic.explode" with volume 1 to player
stop
if {_roll} is 3:
set {heart.%player%} to "Berserker"
send title "&0&l?" with subtitle "&fYou received the &7&k[][] &fheart!" to player
loop 30 times:
play sound "BLOCK.NOTE_BLOCK.PLING" to player
wait 2 ticks
send title "<##A30C13>&l⚔" with subtitle "&fYou received the <##A30C13>&lBERSERKER AXE &fHeart!" to player for 5 seconds
play sound "entity.generic.explode" with volume 1 to player
stop
if {_roll} is 4:
set {heart.%player%} to "Thunder"
send title "&0&l?" with subtitle "&fYou received the &7&k[][] &fheart!" to player
loop 30 times:
play sound "BLOCK.NOTE_BLOCK.PLING" to player
wait 2 ticks
send title "&e&l⚡" with subtitle "&fYou received the &e&lTHUNDER AXE &fheart!" to player for 5 seconds
play sound "entity.generic.explode" with volume 1 to player
stop
if {_roll} is 5:
set {heart.%player%} to "Vitality"
send title "&0&l?" with subtitle "&fYou received the &7&k[][] &fheart!" to player
loop 30 times:
play sound "BLOCK.NOTE_BLOCK.PLING" to player
wait 2 ticks
send title "<##EC51AF>&l❤" with subtitle "&fYou received the <##EC51AF>&lVITALITY AXE &fheart!" to player for 5 seconds
play sound "entity.generic.explode" with volume 1 to player
stop
on rightclick:
player's tool is {axesmp::reroller}
if {reroll.cooldown.%player%} is set:
send "{@prefix} &cWait %{reroll.cooldown.%player%}%s before rerolling again!" to player
stop
remove 1 of {axesmp::reroller} from player's inventory
set {reroll.cooldown.%player%} to 3
set {_roll} to a random integer between 1 and 5
if {_roll} is 1:
set {heart.%player%} to "Frozen"
send title "&0&l?" with subtitle "&fYou received the &7&k[][] &fheart!" to player
loop 30 times:
play sound "BLOCK.NOTE_BLOCK.PLING" to player
wait 2 ticks
send title "<##A3BDFF>&l❄" with subtitle "&fYou received the <##A3BDFF>&lFROZEN AXE &fHeart!" to player for 5 seconds
play sound "entity.generic.explode" with volume 1 to player
stop
if {_roll} is 2:
set {heart.%player%} to "Inferno"
send title "&0&l?" with subtitle "&fYou received the &7&k[][] &fheart!" to player
loop 30 times:
play sound "BLOCK.NOTE_BLOCK.PLING" to player
wait 2 ticks
send title "<##FAC000>&l🔥" with subtitle "&fYou received the <##FAC000>&lINFERNO AXE &fHeart!" to player for 5 seconds
play sound "entity.generic.explode" with volume 1 to player
stop
if {_roll} is 3:
set {heart.%player%} to "Berserker"
send title "&0&l?" with subtitle "&fYou received the &7&k[][] &fheart!" to player
loop 30 times:
play sound "BLOCK.NOTE_BLOCK.PLING" to player
wait 2 ticks
send title "<##A30C13>&l⚔" with subtitle "&fYou received the <##A30C13>&lBERSERKER AXE &fHeart!" to player for 5 seconds
play sound "entity.generic.explode" with volume 1 to player
stop
if {_roll} is 4:
set {heart.%player%} to "Thunder"
send title "&0&l?" with subtitle "&fYou received the &7&k[][] &fheart!" to player
loop 30 times:
play sound "BLOCK.NOTE_BLOCK.PLING" to player
wait 2 ticks
send title "&e&l⚡" with subtitle "&fYou received the &e&lTHUNDER AXE &fheart!" to player for 5 seconds
play sound "entity.generic.explode" with volume 1 to player
stop
if {_roll} is 5:
set {heart.%player%} to "Vitality"
send title "&0&l?" with subtitle "&fYou received the &7&k[][] &fheart!" to player
loop 30 times:
play sound "BLOCK.NOTE_BLOCK.PLING" to player
wait 2 ticks
send title "<##EC51AF>&l❤" with subtitle "&fYou received the <##EC51AF>&lVITALITY AXE &fheart!" to player for 5 seconds
play sound "entity.generic.explode" with volume 1 to player
stop
on rightclick:
player's tool is {axesmp::energy}
if {energy.%player%} >= {@max-energy}:
send "{@prefix} &c⚡ You already have max energy!" to player
stop
if {deposit.cooldown.%player%} is set:
send "{@prefix} &cWait before depositing again!" to player
stop
remove 1 of {axesmp::energy} from player's inventory
add 1 to {energy.%player%}
set {deposit.cooldown.%player%} to 1
send "<##64BEE9>⚡ Deposited energy! &7(%{energy.%player%}% / {@max-energy})" to player
play sound "entity.experience_orb.pickup" with volume 1 to player
command /withdraw [<integer>]:
trigger:
if player's gamemode is creative or spectator:
send "{@prefix} &cCannot withdraw in this gamemode!" to player
stop