I'm trying to lift an item from the ground to change its lore.
The same thing I tried with the item in hand using "player's tool" and it works perfect, but the other change the lone in "{_item1}" does not work. It is the same code, I do not understand it.
it does not work:
Works:
The same thing I tried with the item in hand using "player's tool" and it works perfect, but the other change the lone in "{_item1}" does not work. It is the same code, I do not understand it.
it does not work:
Code:
on pickup:
if player is online:
set {_item1} to item
set {_pick::*} to lore of {_item1}
loop {_pick::*}:
if loop-value contains "&fCrit chance: &9-":
chance of 100%:
replace every "&fCrit chance: &9-" in lore of {_item1} with "&fCrit chance: &93"
stop
chance of 15%:
replace every "&fCrit chance: &9-" in lore of item with "&fCrit chance: &99"
stop
Works:
Code:
on rightclick:
if player is holding a sword or axe,shovel,wooden pickaxe,hoe,bow,trident:
set {_l2::*} to lore of player's tool
loop {_l2::*}:
if loop-value contains "&fCrit chance: &9-":
chance of 80%:
replace every "&fCrit chance: &9-" in lore of tool of player with "&fCrit chance: &93"
stop
chance of 15%:
replace every "&fCrit chance: &9-" in lore of tool of player with "&fCrit chance: &9-"
stop