Custom Items not defined

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

Searis

Member
Jul 9, 2023
2
0
1
So in the Lifesteal-SMP-Plugin the "lives" (hearts) are red dye but with NBT data, in my /dupe script if I blacklist red dye it can still be duped, but if I add the actual ingame name "heart_item" the skript runs into an error. Same with the beacon "revive_beacon" and carrot on a stick "heart_fragment_item" any way to fix this?
Here code:

Code:
options:
    blacklist: command block and bedrock and repeating command block and debug stick and player head and heart fragment item and heart item and revive beacon
    prefix: &r&2Searis Dupe | &r


command /dupe:
    cooldown: 2 seconds
    cooldown message: {@prefix} Before duping again, wait &6%remaining time%!
    cooldown bypass: dupe.cooldown.bypass
    trigger:
        if {@blacklist} contains type of tool:
            send "{@prefix} &3You may &l&4not &r&3dupe that item!"
            stop
        if lore of player's tool contains "&4Undupable":
            send "{@prefix} &3You may &l&4not &r&3dupe that item!"
            stop
        else:
            give player's tool to player
            stop


command /undupe:
    cooldown: 5 seconds
    cooldown message: {@prefix} Before unduping again, wait &6%remaining time%! %nl%&r{@prefix}If you think this is a &4mistake &rcontact a &9developer&r.
    cooldown bypass: dupe.undupe.cooldown.bypass
    trigger:
        if lore of player's tool is empty:
            set lore of player's tool to "&4Undupable"
        
        else:
            add "" to lore of player's tool
            set lore of player's tool to "%lore of player's tool% %nl%&4Undupable"
 
What I would recommend doing, is adding either names or item types that cannot be duped into a list variable. For example:

on load:
clear {Blacklist::*} #Can remove this section after everything is added
add command block to {Blacklist::*}
add bedrock to {Blacklist::*}
add debug stick to {Blacklist::*}
etc

command /dupe:
cooldown: 2 seconds
cooldown message: {@prefix} Before duping again, wait &6%remaining time%!
cooldown bypass: dupe.cooldown.bypass
trigger:
if {Blacklist::*} contains type of tool:
send "{@prefix} &3You may &l&4not &r&3dupe that item!" to player
stop
if lore of player's tool contains "&4Undupable":
send "{@prefix} &3You may &l&4not &r&3dupe that item!" to player
stop
else:
give player's tool to player
stop


Also, by doing this you could easily configure and check what items are blacklisted by sending the variable as a whole (Ie: send "%{Blacklist::*}% to player". I believe your issue before was inputting every blacklisted item into an option. Options I believe (Could be mistaken) are mostly used to refer back to texts/single value type inputs, you'd probably want to use a list variable to store multiple entries most effectively.