#problem with conditional statements being wacky

1 messages · Page 1 of 1 (latest)

wicked fjord
#
                if {_target}'s lore contains "&6Blessed I":
                    cancel event
                    send "&7You already have that enchantment!"                    
                else:
                    chance of {_s} parsed as number%:                        
                        cancel event
                        replace "Empty..." in line 1 of {_target}'s lore with "&6Blessed I"
                        wait 2 ticks
                        set cursor slot of player to air
                        set event-slot to {_target}
                        send "&2Success!"
                        play sound "entity.player.levelup" at volume 10 to player
                    else:    
                        cancel event
                        set player's cursor slot to air
                        send "&4Fail!"
                        play sound "entity.enderman.teleport" at volume 10 to player```
 why does this set cursor slot to air even when the first "if" condition is true "Lore contains blessed"
#

🥺

#

im losing hope 💔

wicked fjord
#

its so jovver

#

@frigid marsh my lord and savior can u help

frigid marsh
#

maybe try to specify the line?

#

wait no that woudn,t work

wicked fjord
#

as {_one}

#

i set every line 1-9 to a local variable

wicked fjord
#

the issue is

#

it goes thru bost

#

both

#

the if

#

and the else

#

it returns the if (send a chat message)

#

and it runs the else (the combine event happens)

#

but

#

the event doesnt fully happen

#

all i need to do is rewrite the "set cursor to air" in a way

#

that works

frigid marsh
#

uh well you can always change the else to else if blah blah

wicked fjord
#

ima also try making an extra condition for deletr

wicked fjord
#

dont i need another else at the end

#

OH

#

i think its bcuz the chance

frigid marsh
#

yeah

#

i think the if doesn't count as an if

wicked fjord
#

yes

#

hm im gettng weird errro

#

r

frigid marsh
#

idk

wicked fjord
#

how do i find line numberes

#

oop foudn it

wicked fjord
frigid marsh
#

🤷‍♂️

wicked fjord
#

rats