Item's lore not working

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

Status
Not open for further replies.
D

Deleted member

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_language.skript:
command /whatistheloreofthisitem:
    permission: debug.loreof
    trigger:
        set {_temp} to the lore of player's tool
        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
 
Last edited by a moderator:
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_language.skript:
command /whatistheloreofthisitem:
    permission: debug.loreof
    trigger:
        set {_temp} to the lore of player's tool
        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
code_language.skript:
# - 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".
command /mask-test:
    trigger:
        give player skull of ("Selvati" parsed as offline player) named "&bSelvati's &dMask"

# - 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)
on place:
    name of player's tool contains "Mask":
        cancel the event
        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 ♥
 
code_language.skript:
# - 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".
command /mask-test:
    trigger:
        give player skull of ("Selvati" parsed as offline player) named "&bSelvati's &dMask"

# - 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)
on place:
    name of player's tool contains "Mask":
        cancel the event
        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 ♥
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!
 
"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.
 
Status
Not open for further replies.