Block break limit 1.20.4

Status

offline

Posts

5

Likes

4

Bits Credits

0

LEVEL

0

195 XP

I need a plugin/scipt to limit the daily breakable spawners with permission. Anyone can help me pls? :D
 

FateKid

DEVIL DID IT

Admin

Status

offline

Posts

14,982

Likes

131,766

Resources

3,400

Bits Credits

512

LEVEL

11

5,910 XP

I need a plugin/scipt to limit the daily breakable spawners with permission. Anyone can help me pls? :D
You can use something like Skript and LuckPerms to accomplish this.
This is merely an example, and I've not confirmed this would actually work, but take a look and modify it where it's needed.

LimitSpawnerBreaks.sk
Code:
options:
    maxDailySpawners: 5

on break of spawner:
    player has permission "spawner.break"
    set {_date} to "%year%-%month%-%day%"
    if {spawnerbreaks::%player's uuid%::%{_date}%} is not set:
        set {spawnerbreaks::%player's uuid%::%{_date}%} to 1
    else:
        add 1 to {spawnerbreaks::%player's uuid%::%{_date}%}
    if {spawnerbreaks::%player's uuid%::%{_date}%} > {@maxDailySpawners}:
        cancel event
        send "&cYou have reached your daily limit of breaking spawners." to player
    else:
        send "&aYou have broken %{spawnerbreaks::%player's uuid%::%{_date}%}%/%{@maxDailySpawners}% spawners today." to player

Here's another version that incorporates some commands, options and more.

Code:
options:
    prefix: &c&lSpawner&4&lLimit&8>>
    maxDailySpawners: 5
    breakSpawnerPermission: spawner.break

on break of spawner:
    player has permission "{@breakSpawnerPermission}"
    set {_date} to "%year%-%month%-%day%"
    set {_uuid} to player's uuid
    if {spawnerBreaks::%{_uuid}%::%{_date}%} is not set:
        set {spawnerBreaks::%{_uuid}%::%{_date}%} to 1
        send "{@prefix} &aYou have broken 1/%{@maxDailySpawners}% spawners today." to player
    else if {spawnerBreaks::%{_uuid}%::%{_date}%} < {@maxDailySpawners}:
        add 1 to {spawnerBreaks::%{_uuid}%::%{_date}%}
        send "{@prefix} &aYou have broken %{spawnerBreaks::%{_uuid}%::%{_date}%}%/%{@maxDailySpawners}% spawners today." to player
    else:
        cancel event
        send "{@prefix} &cYou have reached your daily limit of breaking spawners." to player

command /spawnerlimit:
    permission: admin.spawnerlimit
    permission message: &fUnknown command. Type "/help" for help.
    trigger:
        send "&e--- &cSpawner Break Limit &e---"
        send "&7Use &e/setspawnerlimit <player> <amount> &7to set a player's daily spawner break limit."
        send "&7Use &e/checkspawnerlimit <player> &7to check a player's current spawner breaks."

command /setspawnerlimit <player> <number>:
    permission: admin.spawnerlimit.set
    permission message: &fUnknown command. Type "/help" for help.
    trigger:
        if arg-1 has played before:
            set {customSpawnerLimit::%arg-1's uuid%} to arg-2
            send "{@prefix} &aSet &e%arg-1%'s &aspawner break limit to &e%arg-2%."
        else:
            send "{@prefix} &cPlayer not found."

command /checkspawnerlimit <player>:
    permission: admin.spawnerlimit.check
    permission message: &fUnknown command. Type "/help" for help.
    trigger:
        if arg-1 has played before:
            set {_uuid} to arg-1's uuid
            set {_date} to "%year%-%month%-%day%"
            if {spawnerBreaks::%{_uuid}%::%{_date}%} is not set:
                send "{@prefix} &e%arg-1% &ahas broken &e0 &aspawners today."
            else:
                send "{@prefix} &e%arg-1% &ahas broken &e%{spawnerBreaks::%{_uuid}%::%{_date}%}% &aspawners today."
        else:
            send "{@prefix} &cPlayer not found."
 

FateKid

DEVIL DID IT

Admin

Status

offline

Posts

14,982

Likes

131,766

Resources

3,400

Bits Credits

512

LEVEL

11

5,910 XP

Thank you, you saved me :3 Its working now
Which specific example or skript implementation did you end up going with? Did any of my example skripts work correctly?
 
Liked by:

Latest threads

Forum statistics

Threads
59,567
Messages
90,870
Members
56,574
Latest member
b4444
Top Bottom