Started by
Onyx12133
on
Topic category: Help with Minecraft modding (Java Edition)
I'm trying to make a procedure that returns true if a they have completed a specific advancement and have it return false if they haven't, but I can't save the code because of an error. The error states that "Procedure that uses return value must always end with a valid return block." Does anyone know how I can use an if else statement and return at the same time?
My code so far is:
Event trigger- Player joins world
If Has target entity completed achievement: (Custom advancement)
Do: Return (True)
Else: Return (False)
Edited by Onyx12133 on Sun, 10/31/2021 - 20:09
don't put else, just put it outside of the if statement
If I do that then it always returns false, do you know how I could code it so if they have unlocked the advancement it returns true?
if event target entity has advancement unlocked = ADV
do return true
return false
Huh??
That just returns false
no, if it returns anything, it will stop the procedure and therefore will not get to return:false, in other words:
If true
do return true
return false
will result in return true, switch out the true in if and it will only return true if your condition is met.
Aaah okay, but for some reason my overlay is not showing up.. i cant figure out the problem