Dupe Skript (How to not dupe shulkerboxes with blacklisted items)

  • 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!

XayCraft

Member
Jan 6, 2024
1
0
1
23
options:
# Permissions
blacklist-permission: xay.blacklist
prefix: [&dDupeSteal&f]

# Messages
permission-message: &cInsufficient Permissions
dupe-message: [&dDupeSteal&f] &7Duped your hand.
inventory-full: [&dDupeSteal&f] &7You do not have enough inventory space.
blacklist-add: [&dDupeSteal&f] &7Added to Blacklist.
blacklist-remove: [&dDupeSteal&f] &7Removed from Blacklist.

# Other
world: world
cooldown: 0 seconds

command /dupe [<number>]:
trigger:
if {blacklisted.items::*} contains type of tool:
send "[&dDupeSteal&f] &3| &3You cannot dupe that item!"
stop
else:
if arg-1 is not set:
add player's tool to player's inventory
stop
else:
if arg-1 is less than 2:
add player's tool to player's inventory
stop
else:
if arg-1 is more than 5:
loop 6 times:
add player's tool to player's inventory
stop
else:
loop arg-1 times:
add player's tool to player's inventory

command /blacklist <text="add">:
trigger:
if player doesn't have permission "{@blacklist-permission}":
send "{@permission-message}" to player
stop
if arg-1 = "add":
add type of player's tool to {blacklisted.items::*}
send "{@blacklist-add}" to player
else if arg-1 = "remove":
remove type of player's tool from {blacklisted.items::*}
send "{@blacklist-remove}" to player



How do I make it so I use the {blacklisted.items::*} and make it search the shulker box for items in "{blacklisted.items::*}" and cancel the dupe command if it detects any
 

Attachments

  • DupeSkript.sk
    1.7 KB · Views: 65
My idea as to how to do this would be to check within a given interval if ANY player has a shulker box (This could be every second, use a loop). You then check the NBT of the targeted box to see if it contains a blacklisted item (You can do this using SkBee), if it does you could then have your code either remove the shulker box entirely (Easier) or remove the blacklisted item (Prob a bit harder, not sure if it's possible even) from the NBT itself.