Topic category: Help with Minecraft modding (Java Edition)
I'm creating a simple procedure with an if else, my idea is if the boolean nbt tag of a player is true return true if not return false: The code is something like that:
package net.mcreator.vevanmodprueba.procedures;
/* imports omitted */
public class VevanLogoDisplayOverlayIngameProcedure { public static boolean execute(Entity entity) {
if (entity == null) return false;
if (entity.getPersistentData().getBoolean("JoinLogo") == true) {return true; } else { return false; } } }
I don't understand why I get the error: "Procedure that uses return value must always end with a valid return block" because whatever happens in the procedure one of the two returns should be activated. I don't know if it's my problem that I'm doing something wrong and I don't see it or it's an error. Can someone help me? Or tell me another way to do it. Thanks.
Nevermind, you have to use the if block instead of if else because when the return is executed the procedure ends, the else is not necessary.
PD: Idk if i can delete the question but maybe someone have the same problem and i can accidentally help
This is known limitation, we are working on this fix