#if statements not working

1 messages · Page 1 of 1 (latest)

timber cipher
#

hi

#

let me get paste bin

#

This code here is supposed to set the player to survival and teleport then to a bed. But if the player is in survival mode it should subtract 100 levels and if the player is in creative mode it shouldnt subtract anything. The if statements are being weird and being run without any of the requirements being met. any help?

rancid moat
#

You have ; after your if statements

#

Don’t do that

hybrid crag
#

that compiles??/

rancid moat
#

Also get xp will never be 100

#

It represents the completion progress of a level, from 0-1

#

You probably want getTotalExperience

hybrid crag
#

getTotalExperience

#

Ok

timber cipher
#

Would get levels be better?

rancid moat
#

Oh yeah you gotta do weird math to get the raw total

timber cipher
#

i didnt paste it but, player is defined in the line above the top as command sender

#

nvm

#

I think i fixed!