jils_plays17

============================================================

POWERS SMP - 5 CLAIM + RE-UNLOCK SYSTEM

Minecraft 1.21.x

Required:

- Skript

- SkBee

#

SYSTEM:

Requirement Complete

โ†“

Unlock

โ†“

5 Claims

โ†“

5/5 = LOCK

โ†“

Requirement starts again

โ†“

Unlock again

โ†“

Fresh 5 Claims

#

Every player has separate progress.

============================================================

options: prefix: &8[&dPowers&8] &f maxclaims: 5 cooldown: 60 seconds

============================================================

POWER ITEM

============================================================

function powerItem(power: text) :: item:

set {_i} to nether star

if {_power} is "Creeper": set name of {_i} to "&a๐Ÿ’ฅ Creeper" set lore of {_i} to "&7Power: &aCreeper||&fAbility: Creeper Blast"

else if {_power} is "Enderman": set name of {_i} to "&5๐ŸŒ€ Enderman" set lore of {_i} to "&7Power: &5Enderman||&fAbility: Teleport"

else if {_power} is "Zombie": set name of {_i} to "&2๐ŸงŸ Zombie" set lore of {_i} to "&7Power: &2Zombie||&fAbility: Guardian Zombies"

else if {_power} is "Chicken": set name of {_i} to "&e๐Ÿ” Chicken" set lore of {_i} to "&7Power: &eChicken||&fAbility: Creeper Blast"

else if {_power} is "Magma": set name of {_i} to "&c๐ŸŒ‹ Magma" set lore of {_i} to "&7Power: &cMagma||&fAbility: Fireballs"

else if {_power} is "Breeze": set name of {_i} to "&b๐ŸŒช Breeze" set lore of {_i} to "&7Power: &bBreeze||&fAbility: Dash"

else if {_power} is "Slime": set name of {_i} to "&a๐ŸŸข Slime" set lore of {_i} to "&7Power: &aSlime||&fAbility: Guardian Slimes"

else if {_power} is "Wither": set name of {_i} to "&8โ˜  Wither" set lore of {_i} to "&7Power: &8Wither||&fStrength II||&fAbility: Wither Skull"

else if {_power} is "Warden": set name of {_i} to "&3๐Ÿ‘ Warden" set lore of {_i} to "&7Power: &3Warden||&fRegeneration IV||&fAbility: Sonic Boom"

else if {_power} is "Ender Dragon": set name of {_i} to "&5๐Ÿ‰ Ender Dragon" set lore of {_i} to "&7Power: &5Ender Dragon||&fFlight||&fAbility: Dragon Fireball"

return {_i}

============================================================

GET POWER FROM ITEM

============================================================

function getPower(i: item) :: text:

if {_i} is air: stop

if name of {_i} contains "Creeper": return "Creeper"

if name of {_i} contains "Enderman": return "Enderman"

if name of {_i} contains "Zombie": return "Zombie"

if name of {_i} contains "Chicken": return "Chicken"

if name of {_i} contains "Magma": return "Magma"

if name of {_i} contains "Breeze": return "Breeze"

if name of {_i} contains "Slime": return "Slime"

if name of {_i} contains "Wither": return "Wither"

if name of {_i} contains "Warden": return "Warden"

if name of {_i} contains "Ender Dragon": return "Ender Dragon"

============================================================

CHECK REQUIREMENT

============================================================

function requirementComplete(p: player, power: text) :: boolean:

set {_u} to uuid of {_p}

if {_power} is "Creeper": if {powers.progress.creeper::%{_u}%} >= 75: return true

if {_power} is "Enderman": if {powers.progress.enderman::%{_u}%} >= 576: return true

if {_power} is "Zombie": if {powers.progress.zombie::%{_u}%} >= 50: return true

if {_power} is "Chicken": if {powers.progress.chicken::%{_u}%} >= 100: return true

if {_power} is "Magma": if {powers.progress.magma::%{_u}%} >= 576: return true

if {_power} is "Breeze": if {powers.progress.breeze::%{_u}%} >= 576: return true

if {_power} is "Slime": if {powers.progress.slime::%{_u}%} >= 1728: return true

if {_power} is "Wither": if {powers.progress.wither::%{_u}%} >= 15: return true

if {_power} is "Warden": if {powers.progress.warden::%{_u}%} >= 10: return true

if {_power} is "Ender Dragon": if {powers.progress.dragon::%{_u}%} >= 1: return true

return false

============================================================

UNLOCK + CLAIM

============================================================

function claimPower(p: player, power: text):

set {_u} to uuid of {_p}

# ---------------------------------------- # IF NOT UNLOCKED # ----------------------------------------

if {powers.unlocked.%{_power}%::%{_u}%} is not true:

if requirementComplete({_p}, {_power}) is false: send "{@prefix}&cRequirement is not complete!" to {_p} stop

set {powers.unlocked.%{_power}%::%{_u}%} to true set {powers.claims.%{_power}%::%{_u}%} to 0

send "" to {_p} send "&d&lPOWER UNLOCKED!" to {_p} send "&fPower: &d%{_power}%" to {_p} send "&7You can now claim it &a5 times&7." to {_p} send "" to {_p}

play sound "ui.toast.challenge_complete" to {_p}

# ---------------------------------------- # CLAIM COUNT # ----------------------------------------

set {_claims} to {powers.claims.%{_power}%::%{_u}%}

if {_claims} is not set: set {_claims} to 0

# ---------------------------------------- # 5 CLAIM LIMIT # ----------------------------------------

if {_claims} >= {@maxclaims}:

send "{@prefix}&cThis Power has reached &f5/5 &cclaims." to {_p} send "{@prefix}&eComplete the requirement again to unlock it." to {_p} stop

# ---------------------------------------- # GIVE POWER # ----------------------------------------

give {_p} powerItem({_power})

add 1 to {powers.claims.%{_power}%::%{_u}%}

set {_new} to {powers.claims.%{_power}%::%{_u}%}

send "{@prefix}&aYou claimed &d%{_power}% &a(&f%{_new}%&7/&f5&a)." to {_p}

play sound "entity.player.levelup" to {_p}

# ---------------------------------------- # FIFTH CLAIM # ----------------------------------------

if {_new} >= 5:

send "" to {_p} send "&c&lPOWER DEPLETED!" to {_p} send "&f%{_power}% &cis now locked." to {_p} send "&eComplete the requirement again for another 5 claims." to {_p} send "" to {_p}

# LOCK AGAIN delete {powers.unlocked.%{_power}%::%{_u}%} delete {powers.claims.%{_power}%::%{_u}%}

# RESET REQUIREMENT PROGRESS delete {powers.progress.%{_power}%::%{_u}%}

play sound "block.anvil.land" to {_p}

============================================================

PROGRESS TRACKING

============================================================

on death of creeper:

if attacker is a player: add 1 to {powers.progress.creeper::%uuid of attacker%}

on death of zombie:

if attacker is a player: add 1 to {powers.progress.zombie::%uuid of attacker%}

on death of chicken:

if attacker is a player: add 1 to {powers.progress.chicken::%uuid of attacker%}

on death of wither:

if attacker is a player: add 1 to {powers.progress.wither::%uuid of attacker%}

on death of warden:

if attacker is a player: add 1 to {powers.progress.warden::%uuid of attacker%}

on death of ender dragon:

if killer is a player: add 1 to {powers.progress.dragon::%uuid of killer%}

============================================================

RESOURCE OBTAIN PROGRESS

Counts newly picked-up resources.

============================================================

on pickup of ender pearl:

if event-item is ender pearl: add amount of event-item to {powers.progress.enderman::%uuid of player%}

on pickup of magma block:

if event-item is magma block: add amount of event-item to {powers.progress.magma::%uuid of player%}

on pickup of wind charge:

if event-item is wind charge: add amount of event-item to {powers.progress.breeze::%uuid of player%}

on pickup of slime ball:

if event-item is slime ball: add amount of event-item to {powers.progress.slime::%uuid of player%}

============================================================

POWER GUI

============================================================

command /powers:

trigger:

set {_gui} to chest inventory with 3 rows named "&5&lPowers"

set slot 10 of {_gui} to guiPower(player, "Creeper") set slot 11 of {_gui} to guiPower(player, "Enderman") set slot 12 of {_gui} to guiPower(player, "Zombie") set slot 13 of {_gui} to guiPower(player, "Chicken") set slot 14 of {_gui} to guiPower(player, "Magma") set slot 15 of {_gui} to guiPower(player, "Breeze") set slot 16 of {_gui} to guiPower(player, "Slime") set slot 19 of {_gui} to guiPower(player, "Wither") set slot 20 of {_gui} to guiPower(player, "Warden") set slot 21 of {_gui} to guiPower(player, "Ender Dragon")

open {_gui} to player

============================================================

GUI POWER DISPLAY

============================================================

function guiPower(p: player, power: text) :: item:

set {_i} to powerItem({_power}) set {_u} to uuid of {_p}

if {powers.unlocked.%{_power}%::%{_u}%} is true:

set {_claims} to {powers.claims.%{_power}%::%{_u}%}

if {_claims} is not set: set {_claims} to 0

add "" to lore of {_i} add "&a&lUNLOCKED" to lore of {_i} add "&7Claims: &f%{_claims}%&7/&f5" to lore of {_i} add "&eClick to claim" to lore of {_i}

else:

add "" to lore of {_i} add "&c&lLOCKED" to lore of {_i}

if {_power} is "Creeper": add "&7Requirement: &f75 Creepers" to lore of {_i}

if {_power} is "Enderman": add "&7Requirement: &f576 Ender Pearls" to lore of {_i}

if {_power} is "Zombie": add "&7Requirement: &f50 Zombies" to lore of {_i}

if {_power} is "Chicken": add "&7Requirement: &f100 Chickens" to lore of {_i}

if {_power} is "Magma": add "&7Requirement: &f576 Magma Blocks" to lore of {_i}

if {_power} is "Breeze": add "&7Requirement: &f576 Wind Charges" to lore of {_i}

if {_power} is "Slime": add "&7Requirement: &f1,728 Slime Balls" to lore of {_i}

if {_power} is "Wither": add "&7Requirement: &f15 Withers" to lore of {_i}

if {_power} is "Warden": add "&7Requirement: &f10 Wardens" to lore of {_i}

if {_power} is "Ender Dragon": add "&7Requirement: &f1 Ender Dragon" to lore of {_i}

add "" to lore of {_i} add "&7Progress: &f%getProgress({_p}, {_power})%" to lore of {_i}

return {_i}

============================================================

GET PROGRESS

============================================================

function getProgress(p: player, power: text) :: text:

set {_u} to uuid of {_p}

if {_power} is "Creeper": return "%{powers.progress.creeper::%{_u}%}%/75"

if {_power} is "Enderman": return "%{powers.progress.enderman::%{_u}%}%/576"

if {_power} is "Zombie": return "%{powers.progress.zombie::%{_u}%}%/50"

if {_power} is "Chicken": return "%{powers.progress.chicken::%{_u}%}%/100"

if {_power} is "Magma": return "%{powers.progress.magma::%{_u}%}%/576"

if {_power} is "Breeze": return "%{powers.progress.breeze::%{_u}%}%/576"

if {_power} is "Slime": return "%{powers.progress.slime::%{_u}%}%/1728"

if {_power} is "Wither": return "%{powers.progress.wither::%{_u}%}%/15"

if {_power} is "Warden": return "%{powers.progress.warden::%{_u}%}%/10"

if {_power} is "Ender Dragon": return "%{powers.progress.dragon::%{_u}%}%/1"

return "0"

============================================================

GUI CLICK

============================================================

on inventory click:

if name of event-inventory is "&5&lPowers":

cancel event

if clicked item is air: stop

set {_power} to getPower(clicked item)

if {_power} is not set: stop

claimPower(player, {_power})

wait 2 ticks

execute player command "/powers"

============================================================

ADMIN GIVE

============================================================

command /power give <player> <text>: permission: powers.admin

trigger:

set {_valid} to false

if arg-2 is "Creeper": set {_valid} to true if arg-2 is "Enderman": set {_valid} to true if arg-2 is "Zombie": set {_valid} to true if arg-2 is "Chicken": set {_valid} to true if arg-2 is "Magma": set {_valid} to true if arg-2 is "Breeze": set {_valid} to true if arg-2 is "Slime": set {_valid} to true if arg-2 is "Wither": set {_valid} to true if arg-2 is "Warden": set {_valid} to true if arg-2 is "Ender Dragon": set {_valid} to true

if {_valid} is false: send "{@prefix}&cInvalid Power." to sender stop

set {powers.unlocked.%arg-2%::%uuid of arg-1%} to true set {powers.claims.%arg-2%::%uuid of arg-1%} to 0

give arg-1 powerItem(arg-2)

send "{@prefix}&aGiven &d%arg-2% &ato &f%arg-1%&a."

============================================================

ADMIN RESET

============================================================

command /power reset <player>: permission: powers.admin

trigger:

delete {powers.progress.creeper::%uuid of arg-1%} delete {powers.progress.enderman::%uuid of arg-1%} delete {powers.progress.zombie::%uuid of arg-1%} delete {powers.progress.chicken::%uuid of arg-1%} delete {powers.progress.magma::%uuid of arg-1%} delete {powers.progress.breeze::%uuid of arg-1%} delete {powers.progress.slime::%uuid of arg-1%} delete {powers.progress.wither::%uuid of arg-1%} delete {powers.progress.warden::%uuid of arg-1%} delete {powers.progress.dragon::%uuid of arg-1%}

delete {powers.unlocked.Creeper::%uuid of arg-1%} delete {powers.unlocked.Enderman::%uuid of arg-1%} delete {powers.unlocked.Zombie::%uuid of arg-1%} delete {powers.unlocked.Chicken::%uuid of arg-1%} delete {powers.unlocked.Magma::%uuid of arg-1%} delete {powers.unlocked.Breeze::%uuid of arg-1%} delete {powers.unlocked.Slime::%uuid of arg-1%} delete {powers.unlocked.Wither::%uuid of arg-1%} delete {powers.unlocked.Warden::%uuid of arg-1%} delete {powers.unlocked.Ender Dragon::%uuid of arg-1%}

delete {powers.claims.Creeper::%uuid of arg-1%} delete {powers.claims.Enderman::%uuid of arg-1%} delete {powers.claims.Zombie::%uuid of arg-1%} delete {powers.claims.Chicken::%uuid of arg-1%} delete {powers.claims.Magma::%uuid of arg-1%} delete {powers.claims.Breeze::%uuid of arg-1%} delete {powers.claims.Slime::%uuid of arg-1%} delete {powers.claims.Wither::%uuid of arg-1%} delete {powers.claims.Warden::%uuid of arg-1%} delete {powers.claims.Ender Dragon::%uuid of arg-1%}

send "{@prefix}&aAll Power data reset for &f%arg-1%&a."

============================================================

END

============================================================

Kodari AI
KodariSep 22 at 11:04 am 1
PowerClaimSystem
A GUI-based Minecraft plugin for a Powers SMP that lets players unlock and claim special powers. Each power has a unique requirement (killing mobs or collecting resources) that must be completed to unlock it. Once unlocked, players can claim the power item up to 5 times. After the fifth claim, the power locks again and the requirement resets, allowing players to re-unlock it for another 5 claims. Progress is tracked per player via UUID. Features a 3-row powers GUI with clickable power icons showing locked/unlocked status, claim count, and progress toward requirements. Includes admin commands to give powers directly or reset a player's entire progress data.

Created powers.sk with:

  • Per-player progress tracking

  • Requirement-based unlocks

  • Five claims per unlock cycle

  • Automatic lock and progress reset after 5 claims

  • /powers GUI

  • /power give <player> <power>

  • /power reset <player>

  • Progress display and claim handling

  • Protection against clicking player inventory slots

  • Skript/SkBee-compatible item and GUI logic

Kodari can make mistakes. Review important code before using.
Files
powers.sk
Code
1 348
powers.sk
options:
    prefix: &8[&dPowers&8] &f
    maxclaims: 5

function powerItem(power: text) :: item:
    set {_item} to nether star

    if {_power} is "Creeper":
        set name of {_item} to "&a๐Ÿ’ฅ Creeper"
        set lore of {_item} to "&7Power: &aCreeper||&fAbility: Creeper Blast"
    else if {_power} is "Enderman":
        set name of {_item} to "&5๐ŸŒ€ Enderman"
        set lore of {_item} to "&7Power: &5Enderman||&fAbility: Teleport"
    else if {_power} is "Zombie":
        set name of {_item} to "&2๐ŸงŸ Zombie"
        set lore of {_item} to "&7Power: &2Zombie||&fAbility: Guardian Zombies"
    else if {_power} is "Chicken":
        set name of {_item} to "&e๐Ÿ” Chicken"
        set lore of {_item} to "&7Power: &eChicken||&fAbility: Creeper Blast"
    else if {_power} is "Magma":
        set name of {_item} to "&c๐ŸŒ‹ Magma"
        set lore of {_item} to "&7Power: &cMagma||&fAbility: Fireballs"
    else if {_power} is "Breeze":
        set name of {_item} to "&b๐ŸŒช Breeze"
        set lore of {_item} to "&7Power: &bBreeze||&fAbility: Dash"
    else if {_power} is "Slime":
        set name of {_item} to "&a๐ŸŸข Slime"
        set lore of {_item} to "&7Power: &aSlime||&fAbility: Guardian Slimes"
    else if {_power} is "Wither":
        set name of {_item} to "&8โ˜  Wither"
        set lore of {_item} to "&7Power: &8Wither||&fStrength II||&fAbility: Wither Skull"
    else if {_power} is "Warden":
        set name of {_item} to "&3๐Ÿ‘ Warden"
        set lore of {_item} to "&7Power: &3Warden||&fRegeneration IV||&fAbility: Sonic Boom"
    else if {_power} is "Ender Dragon":
        set name of {_item} to "&5๐Ÿ‰ Ender Dragon"
        set lore of {_item} to "&7Power: &5Ender Dragon||&fFlight||&fAbility: Dragon Fireball"

    return {_item}

function getPower(item: item) :: text:
    if {_item} is air:
        stop

    if name of {_item} contains "Creeper":
        return "Creeper"
    if name of {_item} contains "Enderman":
        return "Enderman"
    if name of {_item} contains "Zombie":
        return "Zombie"
    if name of {_item} contains "Chicken":
        return "Chicken"
    if name of {_item} contains "Magma":
        return "Magma"
    if name of {_item} contains "Breeze":
        return "Breeze"
    if name of {_item} contains "Slime":
        return "Slime"
    if name of {_item} contains "Wither":
        return "Wither"
    if name of {_item} contains "Warden":
        return "Warden"
    if name of {_item} contains "Ender Dragon":
        return "Ender Dragon"

function requirementComplete(player: player, power: text) :: boolean:
    set {_uuid} to uuid of {_player}

    if {_power} is "Creeper":
        return {powers.progress.creeper::%{_uuid}%} >= 75
    if {_power} is "Enderman":
        return {powers.progress.enderman::%{_uuid}%} >= 576
    if {_power} is "Zombie":
        return {powers.progress.zombie::%{_uuid}%} >= 50
    if {_power} is "Chicken":
        return {powers.progress.chicken::%{_uuid}%} >= 100
    if {_power} is "Magma":
        return {powers.progress.magma::%{_uuid}%} >= 576
    if {_power} is "Breeze":
        return {powers.progress.breeze::%{_uuid}%} >= 576
    if {_power} is "Slime":
        return {powers.progress.slime::%{_uuid}%} >= 1728
    if {_power} is "Wither":
        return {powers.progress.wither::%{_uuid}%} >= 15
    if {_power} is "Warden":
        return {powers.progress.warden::%{_uuid}%} >= 10
    if {_power} is "Ender Dragon":
        return {powers.progress.dragon::%{_uuid}%} >= 1

    return false

function claimPower(player: player, power: text):
    set {_uuid} to uuid of {_player}

    if {powers.unlocked.%{_power}%::%{_uuid}%} is not true:
        if requirementComplete({_player}, {_power}) is false:
            send "{@prefix}&cRequirement is not complete!" to {_player}
            stop

        set {powers.unlocked.%{_power}%::%{_uuid}%} to true
        set {powers.claims.%{_power}%::%{_uuid}%} to 0

        send "" to {_player}
        send "&d&lPOWER UNLOCKED!" to {_player}
        send "&fPower: &d%{_power}%" to {_player}
        send "&7You can now claim it &a5 times&7." to {_player}
        send "" to {_player}
        play sound "ui.toast.challenge_complete" to {_player}

    set {_claims} to {powers.claims.%{_power}%::%{_uuid}%}
    if {_claims} is not set:
        set {_claims} to 0

    if {_claims} >= {@maxclaims}:
        send "{@prefix}&cThis Power has reached &f5/5 &cclaims." to {_player}
        send "{@prefix}&eComplete the requirement again to unlock it." to {_player}
        stop

    give powerItem({_power}) to {_player}
    add 1 to {powers.claims.%{_power}%::%{_uuid}%}
    set {_newClaims} to {powers.claims.%{_power}%::%{_uuid}%}

    send "{@prefix}&aYou claimed &d%{_power}% &a(&f%{_newClaims}%&7/&f5&a)." to {_player}
    play sound "entity.player.levelup" to {_player}

    if {_newClaims} >= {@maxclaims}:
        send "" to {_player}
        send "&c&lPOWER DEPLETED!" to {_player}
        send "&f%{_power}% &cis now locked." to {_player}
        send "&eComplete the requirement again for another 5 claims." to {_player}
        send "" to {_player}

        delete {powers.unlocked.%{_power}%::%{_uuid}%}
        delete {powers.claims.%{_power}%::%{_uuid}%}
        delete {powers.progress.%{_power}%::%{_uuid}%}
        play sound "block.anvil.land" to {_player}

function getProgress(player: player, power: text) :: text:
    set {_uuid} to uuid of {_player}

    if {_power} is "Creeper":
        set {_progress} to {powers.progress.creeper::%{_uuid}%}
        set {_required} to 75
    else if {_power} is "Enderman":
        set {_progress} to {powers.progress.enderman::%{_uuid}%}
        set {_required} to 576
    else if {_power} is "Zombie":
        set {_progress} to {powers.progress.zombie::%{_uuid}%}
        set {_required} to 50
    else if {_power} is "Chicken":
        set {_progress} to {powers.progress.chicken::%{_uuid}%}
        set {_required} to 100
    else if {_power} is "Magma":
        set {_progress} to {powers.progress.magma::%{_uuid}%}
        set {_required} to 576
    else if {_power} is "Breeze":
        set {_progress} to {powers.progress.breeze::%{_uuid}%}
        set {_required} to 576
    else if {_power} is "Slime":
        set {_progress} to {powers.progress.slime::%{_uuid}%}
        set {_required} to 1728
    else if {_power} is "Wither":
        set {_progress} to {powers.progress.wither::%{_uuid}%}
        set {_required} to 15
    else if {_power} is "Warden":
        set {_progress} to {powers.progress.warden::%{_uuid}%}
        set {_required} to 10
    else if {_power} is "Ender Dragon":
        set {_progress} to {powers.progress.dragon::%{_uuid}%}
        set {_required} to 1
    else:
        return "0/0"

    if {_progress} is not set:
        set {_progress} to 0

    return "%{_progress}%/%{_required}%"

function guiPower(player: player, power: text) :: item:
    set {_item} to powerItem({_power})
    set {_uuid} to uuid of {_player}

    if {powers.unlocked.%{_power}%::%{_uuid}%} is true:
        set {_claims} to {powers.claims.%{_power}%::%{_uuid}%}
        if {_claims} is not set:
            set {_claims} to 0

        add "" to lore of {_item}
        add "&a&lUNLOCKED" to lore of {_item}
        add "&7Claims: &f%{_claims}%&7/&f5" to lore of {_item}
        add "&eClick to claim" to lore of {_item}
    else:
        add "" to lore of {_item}
        add "&c&lLOCKED" to lore of {_item}

        if {_power} is "Creeper":
            add "&7Requirement: &f75 Creepers" to lore of {_item}
        else if {_power} is "Enderman":
            add "&7Requirement: &f576 Ender Pearls" to lore of {_item}
        else if {_power} is "Zombie":