Procedure that uses return value must always end with a valid return block

Started by TiQuon_ on

Topic category: Help with Minecraft modding (Java Edition)

Joined Sep 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Procedure that uses return value must always end with a valid return block
Sat, 03/01/2025 - 01:54 (edited)

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.

Edited by TiQuon_ on Sat, 03/01/2025 - 01:54