#question

1 messages · Page 1 of 1 (latest)

sterile basin
#
%itemstack/itemtype%'[s] lore 
[the] line %number% of [the] lore of %itemstack/itemtype% 
[the] line %number% of %itemstack/itemtype%'[s] lore 
[the] %number%(st|nd|rd|th) line of [the] lore of %itemstack/itemtype% 
[the] %number%(st|nd|rd|th) line of %itemstack/itemtype%'[s] lore```

`if lore of item contains "Sus!":`
and then i dont know if this might work but:
`replace all "sus" in lore of item with "sus"`
fringe ingot
#

Get lore And save it to variable then replace it and then put it back as lore

austere needle
#

it will just set a lore line as a empty text

#

I dont want to replace it guys

#

i want to get rid of it

fringe ingot
#

Its will not

#

Tbh make a fn for it

austere needle
#

let me go see then

fringe ingot
#

Okey

austere needle
#

"The lore of loop-item cannot be changed"

#

cannot be replaced

#

just tell me how to find the line index of the specific lore

austere needle
fringe ingot
#

Sec

austere needle
#

I don't know how to do that

#

function you mean?

#

i don't know how to do functions

fringe ingot
#
function replaceLore(item: item, search: string):
    set {_lore::*} to lore of {_item}
    replace all {_search} in {_lore::*}
    set {_item}'s lore to {_lore::*}
    send "replaced lore... %{_item}'s lore%" to console
#

that's i mean

austere needle
#

yeah honestly i just didnt know how to do the parameters part

#

wait what does _search do

fringe ingot
#

the "sus"

#
function replaceLore(item: item, search: string):
    set {_lore::*} to lore of {_item}
    replace all {_search} in {_lore::*}
    set {_item}'s lore to {_lore::*}
    send "replaced lore... %{_item}'s lore%" to console


on load:
    set {_i} to iron sword named "test"
    set {_i}'s lore to "testsus", "test1sus"
    replaceLore({_i}, "sus")
austere needle
fringe ingot
#

replace all {_search} in {_lore::*} with ""

austere needle
#

function replaceLore(item: item, search: string):
set {_lore::} to lore of {_item}
replace all {_search} in {_lore::
} with ""
set {_item}'s lore to {_lore::*}
send "replaced lore... %{_item}'s lore%" to console

on jump:
set {_i} to iron sword named "&rtest"
set {_i}'s lore to "&rtestsus", "&rtest1sus"
give {_i} to player
wait 5 ticks
replaceLore({_i}, "sus")

#

i changed the event bc it wasnt working

#

but uh

#

its not working

#

but it does say

#

[07:40:12 INFO]: replaced lore... test and test1

#

in console

austere needle
#

@fringe ingot ?

fringe ingot
#

yes?

#

just change the fn

#

and make it return the changed values

fringe ingot
#
function replaceLore(item: item, search: string) :: strings:
    set {_lore::*} to lore of {_item}
    replace all {_search} in {_lore::*}
    set {_item}'s lore to {_lore::*}
    return {_item}'s lore


on load:
    set {_i} to iron sword named "test"
    set {_i}'s lore to "testsus", "test1sus"
    send replaceLore({_i}, "sus")
austere needle
#

except it shows in chat now the test and test1

austere needle
#

@fringe ingot

fringe ingot
#

Yes?

austere needle
austere needle
#

i even took it out of the function and it still didnt work

austere needle
#

making the lore to just "" doesnt clear it it just makes it empty

fringe ingot
#

bro

#

you shall basically

#

did everything with it

austere needle
#

can you show me how to delete the line index of what line the lore is on

fringe ingot
#

wdym?

austere needle
#

its a list right

#

with indexs

#

if you delete one of the indexs it deletes the lore

fringe ingot
#

it does not

#

send me your whole code

austere needle
#

on jump:
set {_item} to stone with lore "banaana"
replace every "banaana" in lore of {_item} with ""
give {_item} to player

#

i cannot have empty lore bc it doesnt work with shopkeepers

fringe ingot
#

well

#

so you can basically

#

set it to another?

#
on jump:
    set {_item} to stone with lore "banaana"
    replace every "banaana" in lore of {_item} with "lala"
    give {_item} to player
austere needle
#

i cannot do that xDDD

fringe ingot
#

wtf

#

your description

#

is like

austere needle
#

im not remaking everything again

fringe ingot
#
on load:
  set {_item} to iron sword with lore "A", "B"
  send removeLine("A", {_item})

function removeLine(search: String, item: itemtype) :: objects:
set {_lores::*} to {_item}'s lore
loop {_lores::*}:
  if loop-value != {_serach}:
    add loop-value to {_newLore::*}
return {_newLore::*}
#

you never said you need a remove the line

#

you talk all the time about replace or changing

austere needle
#

^ "delete"

austere needle
fringe ingot
#

well sorry

austere needle
fringe ingot
#

try it

austere needle
fringe ingot
#

miss interpreted.

austere needle
#

look im just learning and im trying to listen to your side ok

fringe ingot
#

ye, i just basically have so much work

#

so i answering in quick time

#

without deep mind.

austere needle
#

im sorry

#

ok it sent me a b in chat

#

and it gave me a sword with the lore a and b

#

isnt search supposed to be set to something

fringe ingot
#

yes

#

you need to use it only for change lore

#

if you want return a itemtype

#

you may change the output

austere needle
#

it doesnt do anything smh

fringe ingot
#

sec

austere needle
#

huh

fringe ingot
#
on jump:
  set {_item} to iron sword with lore "A", "B"
  send removeLine("A", {_item})

function removeLine(search: String, item: itemtype) :: item:
set {_lores::*} to {_item}'s lore
loop {_lores::*}:
  if loop-value != {_serach}:
    add loop-value to {_newLore::*}

set {_returnItem} to {_item}
set {_returnItem}'s name to {_item}'s name
set {_returnItem}'s lore to {_newLore::*}

return {_returnItem}
austere needle
#

nope

fringe ingot
#

bro im not stupid at all

#

so i rlly don't understood why you came for help.... without actually listening

austere needle
#

can you send me that code

#

nvm

austere needle
#

you just didnt show me it right

fringe ingot
#

well