How to call procedure at specific location and still get return value

Started by IFthenElse246 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Feb 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to call procedure at specific location and still get return value

You can call a procedure at a different location with a block, or you can call a procedure and get the return value with a block... but not both.  I have limited Java Knowledge but I thought I might be able to figure out how to combine the code of those two blocks but I'm stumped.

Code for calling procedure at a different location:

IWorld world = (IWorld) dependencies.get("world");
		{
			Map<String, Object> $_dependencies = new HashMap<>();
			$_dependencies.put("world", world);
			$_dependencies.put("x", x);
			$_dependencies.put("y", y);
			$_dependencies.put("z", z);
			ProcedureName.executeProcedure($_dependencies);
		}

 

Code for calling a procedure and getting the return value:

ProcedureName.executeProcedure(ImmutableMap.of("world", world))

Can someone help me figure out how to combine these?

Thanks for any help!

Joined Feb 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Seriously though, this is…
Mon, 11/22/2021 - 13:38

Seriously though, this is very important for my mod...