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 Check if a player has a named item

Discussion in 'Skript' started by ImKingGolden, Jul 13, 2021.

Thread Status:
Not open for further replies.
  1. ImKingGolden

    ImKingGolden Member

    Joined:
    Aug 11, 2020
    Messages:
    21
    Likes Received:
    1
    I tried looping the players inventory, and if player has a item named "&6Test" but nothing works any help would be great
    Code (Text):
    1. if player has a stick named "&6Fishing Rod Handle":
    2.                     send "&eTest" to player
     
  2. AHappyLittleSloth

    Joined:
    Apr 22, 2020
    Messages:
    48
    Likes Received:
    4
    Code (Text):
    1. command /check <player>:
    2.   trigger:
    3.     if player has stick named "&6Fishing Rod Handle":
    4.       broadcast "yes"
     
  3. ImKingGolden

    ImKingGolden Member

    Joined:
    Aug 11, 2020
    Messages:
    21
    Likes Received:
    1
    Didn't work thanks for the help though
     
  4. Minecoll_YT

    Supporter Forums Helper

    Joined:
    Dec 2, 2018
    Messages:
    650
    Likes Received:
    39
    Try
    Code (Text):
    1. if amount of stick named "&6Fishing Rod Handle" in player's inventory is more than 0:
    2.  
    or
    Code (Text):
    1. set {_item} to stick named "&6Fishing Rod Handle"
    2. if amount of {_item} in player's inventory is more than 0:
     
    • Like Like x 1
  5. AHappyLittleSloth

    Joined:
    Apr 22, 2020
    Messages:
    48
    Likes Received:
    4
    I tested this on my server and it works just fine. Make sure the name matches perfectly. Also what version of script are you using?
    --- Double Post Merged, Jul 15, 2021, Original Post Date: Jul 14, 2021 ---
    This works for me with no addons: Skript version 2.6-beta2

    Code (Text):
    1. command /check <player>:
    2.   trigger:
    3.     set arg-1's tool to 1 stick named "&6Fishing Rod Handle"
    4.     if arg-1 has stick named "&6Fishing Rod Handle":
    5.       broadcast "yes"
     
    • Like Like x 1
  6. ImKingGolden

    ImKingGolden Member

    Joined:
    Aug 11, 2020
    Messages:
    21
    Likes Received:
    1
    I got it working thanks for the help, for some reason it needed the lore as well as the name
     
Thread Status:
Not open for further replies.

Share This Page

Loading...