Solved How to protect shulker box and specific drop?

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.
Mar 29, 2020
28
0
1
28
Hello, does anyone know how to protect a shulker box so that it is not stolen by other players? I want this: when a player puts a shulker box, he can only take it and not other players. I also want to know how to protect a specific drop and that only the assassin can take that specific item. Thank you !!! :emoji_slight_smile:
 
Attention, this script is not 100% safe, have some bugs, but this complicate the things a lot.
Is just a simple script :emoji_grinning:
Later edit: now i saw as you want to leave the attacker to take items from shulker, or to pickup the shulker ... sorry
Code:
on place:
    If "%event-block%" contain " shulker box":
        send "&aProtection set at &6%location of event-block%"
        set {mysterygift.%location of event-block%} to uuid of event-player

on break:
    If "%event-block%" contain " shulker box":
        if player is op:
            send "&aProtection removed at &6%location of event-block%"
            delete {mysterygift.%location of event-block%}
            stop
        if {mysterygift.%location of event-block%} is uuid of event-player:
            send "&aProtection removed at &6%location of event-block%"
            delete {mysterygift.%location of event-block%}
            stop
        else:
            cancel event
            send "&4Error: &cThis shulker box isn't yours!"

on rightclick:
    If "%event-block%" contain " shulker box":
        if player is op:
            stop
        if {mysterygift.%location of event-block%} is uuid of event-player:
            stop
        else:
            cancel event
            send "&4Error: &cThis shulker box isn't yours!"

on place of hopper or normal rail or powered rail or detector rail or activator rail: #yep, isn't mine!
    if "%block above event-block%" contain " shulker box":
        if player is op:
            stop
        if {mysterygift.%location of block above event-block%} is uuid of event-player:
            stop
        else:
            cancel event
            send "&4Error: &cThis shulker box isn't yours!"
 
Last edited:
Attention, this script is not 100% safe, have some bugs, but this complicate the things a lot.
Is just a simple script :emoji_grinning:
Later edit: now i saw as you want to leave the attacker to take items from shulker, or to pickup the shulker ... sorry
Code:
on place:
    If "%event-block%" contain " shulker box":
        send "&aProtection set at &6%location of event-block%"
        set {mysterygift.%location of event-block%} to uuid of event-player

on break:
    If "%event-block%" contain " shulker box":
        if player is op:
            send "&aProtection removed at &6%location of event-block%"
            delete {mysterygift.%location of event-block%}
            stop
        if {mysterygift.%location of event-block%} is uuid of event-player:
            send "&aProtection removed at &6%location of event-block%"
            delete {mysterygift.%location of event-block%}
            stop
        else:
            cancel event
            send "&4Error: &cThis shulker box isn't yours!"

on rightclick:
    If "%event-block%" contain " shulker box":
        if player is op:
            stop
        if {mysterygift.%location of event-block%} is uuid of event-player:
            stop
        else:
            cancel event
            send "&4Error: &cThis shulker box isn't yours!"

on place of hopper or normal rail or powered rail or detector rail or activator rail: #yep, isn't mine!
    if "%block above event-block%" contain " shulker box":
        if player is op:
            stop
        if {mysterygift.%location of block above event-block%} is uuid of event-player:
            stop
        else:
            cancel event
            send "&4Error: &cThis shulker box isn't yours!"
Excellent work, it seems that this has to work! I'm going to try it and I'll let you know if it worked!
 
Excellent work, it seems that this has to work! I'm going to try it and I'll let you know if it worked!
I forgot to specify:
I make it on 1.16.4 paper server with latest skript version and skquery (i have always skquery in server) if not work, try to update the server or plugins, or let my know of you use a another version.
 
Status
Not open for further replies.