1. 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!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Undroppable items.

Discussion in 'Requests' started by Cellox, May 15, 2022.

  1. Cellox

    Cellox New Member

    Joined:
    May 15, 2022
    Messages:
    6
    Likes Received:
    0
    Hello,

    i'm searching for a skript that can add something like a lore or tag to a specific item with a command that makes it impossible to drop or put that item into a chest, but once the player dies with that item the lore/tag is removed from the item and people can pick it up and keep it.
     
  2. BanditEagle

    BanditEagle Active Member

    Joined:
    May 3, 2021
    Messages:
    55
    Likes Received:
    0
    The skUnity parser returned no errors, so I think it should work. If it doesn't, please let me know.
    Code (Text):
    1. on drop:
    2.     set {_lores::*} to lore of event-item
    3.     if {_lores::*} contains "Undroppable":
    4.         cancel event
    5.         send "You can't drop this item"
    6.  
    7. on inventory click:
    8.     set {_lores::*} to lore of event-item
    9.     if {_lores::*} contains "Undroppable":
    10.         cancel event
    11.         send "You can't move this item"
    12.  
    13. command /undroplore:
    14.     trigger:
    15.         if player's held item is set:
    16.             set {_tool} to player's held item
    17.             remove player's held item from player
    18.             set {_lores::*} to lore of {_tool}
    19.             set {_size} to size of {_lores::*}
    20.             set {_lores::%{_size}+1%} to "Undroppable"
    21.             set {_item} to {_tool} with lore "%{_lores::*}%"
    22.             give player {_item}
     
  3. Cellox

    Cellox New Member

    Joined:
    May 15, 2022
    Messages:
    6
    Likes Received:
    0
    It's given me this:


    [15:42:20 ERROR]: [Skript] 'lore' is not a number (undroppable.sk, line 2: set {_lores::*} to lore of event-item')
    [15:42:20 ERROR]: [Skript] can't understand this event: 'on inventory click' (undroppable.sk, line 7: on inventory click:')
    [15:42:20 ERROR]: [Skript] 'lore' is not a number (undroppable.sk, line 18: set {_lores::*} to lore of {_tool}')
    [15:42:20 ERROR]: [Skript] '{_lores::%{_size}+1%}' is not an entity type (undroppable.sk, line 20: set {_lores::%{_size}+1%} to "Undroppable"')
    [15:42:20 ERROR]: [Skript] '{_tool} with lore "%{_lores::*}%"' is not an entity type (undroppable.sk, line 21: set {_item} to {_tool} with lore "%{_lores::*}%"')
     
  4. BanditEagle

    BanditEagle Active Member

    Joined:
    May 3, 2021
    Messages:
    55
    Likes Received:
    0
    what is your skript version?
     
  5. Cellox

    Cellox New Member

    Joined:
    May 15, 2022
    Messages:
    6
    Likes Received:
    0
    Oh wow! i didn't even notice/knew this was a whole new skript based off the orginal skript. But yeah... I'm still on 1.7.10 because i run a modded server.
     
  6. BanditEagle

    BanditEagle Active Member

    Joined:
    May 3, 2021
    Messages:
    55
    Likes Received:
    0
    Using lores will only work on skript versions 2.1 and more recent. My next best bet would be to use NBT tags with SkBee.
     
  7. Cellox

    Cellox New Member

    Joined:
    May 15, 2022
    Messages:
    6
    Likes Received:
    0
    Ah, so in my situation it would be better to make a plugin for this?
     
  8. BanditEagle

    BanditEagle Active Member

    Joined:
    May 3, 2021
    Messages:
    55
    Likes Received:
    0
    Not to make a plugin but just to use the SkBee addon for it and use NBT tags with it.
     
  9. Cellox

    Cellox New Member

    Joined:
    May 15, 2022
    Messages:
    6
    Likes Received:
    0
    Yeahh i've looked at Skbee but i as far as i can see it's not available for 1.7.10
     
  10. BanditEagle

    BanditEagle Active Member

    Joined:
    May 3, 2021
    Messages:
    55
    Likes Received:
    0
    Oh i see. In that case, unless there is some other plugin that works with 1.7.10 and supports lores or nbts, creating your own plugin for it would be the way to go. Sorry I couldn't help more.
     
  11. Cellox

    Cellox New Member

    Joined:
    May 15, 2022
    Messages:
    6
    Likes Received:
    0
    Oh no worries! You atleast was willing to help which i appreciate a lot! Just sucks that i'm still forced on such a old version of MC, but can't do much about that unfortunately.
     

Share This Page

Loading...