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.

Item's lore not working

Discussion in 'Skript' started by Hibrocolomedio, Dec 23, 2017.

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

    Joined:
    Dec 14, 2017
    Messages:
    18
    Likes Received:
    0
    Hello!
    I am working on disabling the placement of every head that has the lore '&dMask', so it can't loose it's name and lore after placing and breaking it, as that would be a normal player head and not a Mask that our Skript adds special abilities.

    I have tryed to use the following Skript:


    However, that does not seem working.
    I tryed to debug where is the problem and I wrote the following Skript:
    Code (Skript):
    1. command /whatistheloreofthisitem:
    2.     permission: debug.loreof
    3.     trigger:
    4.         set {_temp} to the lore of player's tool
    5.         message "%lore of {_temp}%" to player
    When I do /whatistheloreofthisitem it returns <none>, even though the item I am holding has a lore.
    However if I rewrite it to the name of player's tool it returns the tool's name I'm holding.

    So is it just me screwing things up, or is this a Skript bug?

    Thanks.

    Skript Version: Latest Skript by Bensku
    Skript Author: Bensku
    Minecraft Version: 1.12.2
    Errors on Reload: none
    Have you tried searching the docs? Yes
    Have you tried searching the forums? Yes
    What other methods have you tried to fix it? none
     
    #1 Hibrocolomedio, Dec 23, 2017
    Last edited: Dec 23, 2017
  2. FUZIK

    FUZIK Active Member

    Joined:
    Jan 26, 2017
    Messages:
    115
    Likes Received:
    10
    "%player's tool%" is <none>?
     
  3. Hibrocolomedio

    Joined:
    Dec 14, 2017
    Messages:
    18
    Likes Received:
    0
    Pasted the wrong code in. Edited now.
     
  4. FUZIK

    FUZIK Active Member

    Joined:
    Jan 26, 2017
    Messages:
    115
    Likes Received:
    10
    what return?
    Code (Skript):
    1.  
    2. command new_bug:
    3.     trigger:
    4.       message "lore  %lore of tool of player%"
    5.       message "tool  %tool of player%"
    6.  
     
  5. Selvati

    Selvati Active Member

    Joined:
    Jun 26, 2017
    Messages:
    190
    Likes Received:
    10
    Code (Skript):
    1. # - Command that will show you an example of a skull/head that will work for the code below, this code will block the placement of any block with its name contains "Mask".
    2. command /mask-test:
    3.     trigger:
    4.         give player skull of ("Selvati" parsed as offline player) named "&bSelvati's &dMask"
    5.  
    6. # - This was a lot quicker to write, so I apologize it checking the block's name instead of lore (I couldn't get the lore check to work for me)
    7. on place:
    8.     name of player's tool contains "Mask":
    9.         cancel the event
    10.         send "&7You cannot place masks, silly."
    I hastily wrote this to help you as it was not a huge request, I for whatever reason could not successfully check for the block's lore (Checking for block lore in an on place event and also checking if the placed block was a skull/head also failed so I decided to use the name of the player's held item, which is the block they're holding in an on place event)

    I hope this helps you if it doesn't completely solve your problems, best of wishes,
    ~Selvati ♥
     
  6. Hibrocolomedio

    Joined:
    Dec 14, 2017
    Messages:
    18
    Likes Received:
    0
    I have tried the same thing, it works I mean but if there are more types of masks than I will have to add each and every one of them.
    Anyway, thanks for the help!
     
  7. Selvati

    Selvati Active Member

    Joined:
    Jun 26, 2017
    Messages:
    190
    Likes Received:
    10
    "it works I mean but if there are more types of masks than I will have to add each and every one of them." That is nothing hard, it should be easy since I've already wrote it and you have it in front of you, if you don't think it is worth it even now, that's laziness to me.. anyways Merry Christmas.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...