Solved How to check lore of item if it has multiple lines?

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

CrimZ0N

Member
Jan 28, 2017
56
3
8
24
Heya, been a while, here's a tldr.

If I set an item to have lore "example" and then lets say "if lore of item contains "example"", it works, however, if I set the lore to "example1" and "example2" and then I check the lore for the same thing, it doesn't work.

An example of what I'm trying to do

command /stick:
trigger:
give player 1 stick with lore "example1" and "example2"

on left click:
if tool of player is stick:
if lore of item contains "example1":
message "Stick"

Please do note that the lore's will vary and I want to check for multiple lines, and I tried to include both lines of lore in the "if lore of item contains", it didn't work. Am I doing it wrong, or is it impossible?

Currently using bensku's fork v2.4.1 and SkQuery v4.1.1

Cheers
 
Lore is now returned as a list of strings (set {_lore::*} to lore of item), so you need to specify a line (line 2 of lore, {_lore::2}, etc ...) or just place the entire lore in a string.

Example:
code_language.skript:
if uncolored line 1 of the lore of the item contains "example1":

if "%uncolored lore of item%" contains "example1":

set {_lore::*} to uncolored lore of item
loop {_lore::*}:
  if loop-value contains "example1":


Also, please format code with the insert code button.
 
Lore is now returned as a list of strings (set {_lore::*} to lore of item), so you need to specify a line (line 2 of lore, {_lore::2}, etc ...) or just place the entire lore in a string.

Example:
code_language.skript:
if uncolored line 1 of the lore of the item contains "example1":

if "%uncolored lore of item%" contains "example1":

set {_lore::*} to uncolored lore of item
loop {_lore::*}:
  if loop-value contains "example1":


Also, please format code with the insert code button.

Thanks, that solved it. I kept doing "if lore of item", no wonder it wasn't working, smh.
 
Status
Not open for further replies.