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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

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

Solved Failed to check if player is holding an enchanted item

Discussion in 'Skript' started by mtrD359360, Feb 12, 2020.

  1. mtrD359360

    mtrD359360 Member

    Joined:
    May 2, 2017
    Messages:
    16
    Likes Received:
    1
    Skript Version: Skript 2.4.1
    Skript Author: Bensku
    Minecraft Version: 1.12.2

    I want to check if a player is holding an item as follow:
    Code (Text):
    1. on right click:      
    2.     if player's tool is Name Tag of Unbreaking 5:
    3.         (do something)
    4.  
    But when I use a Name Tag with Unbreaking 5 enchantment to right click something, the if doesn't count as true .
    I've also tested this, but neither works:
    Code (Text):
    1. on right click:      
    2.     if player is holding Name Tag of Unbreaking 5:
    3.         (do something)
    While I changed the code a bit, like this:
    Code (Text):
    1. on right click:      
    2.     if player's tool is Name Tag:
    3.         (do something)
    4.  
    It does work, the action in the "if" runs.
    What is the problem? Or any alternative code I can use to get the same result?

    Addons using (including versions):
    TuSKe 1.8.2
     
    #1 mtrD359360, Feb 12, 2020
    Last edited: Feb 12, 2020
  2. Conutik

    Conutik Member

    Joined:
    Jan 12, 2020
    Messages:
    19
    Likes Received:
    1
    Code (Text):
    1. On rightclick:
    2.   if player's tool is Name tag:
    3.     if lore of player's tool contains "Unbreaking V":
    4.       # do stuff
     
  3. Goose

    Goose Well-Known Member

    Joined:
    Nov 23, 2019
    Messages:
    373
    Likes Received:
    21
    you realize enchantments are not stored in lore right
     
Loading...