Procudeing failing to build

Started by Alzrag on

Topic category: Troubleshooting, bugs, and solutions

Last seen on 19:18, 10. Feb 2024
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Procudeing failing to build

this pocedure to teliport the player 12 blocks forward is not compiling properly

 

this is the consol feedback

 

Executing Gradle task: build
Build info: MCreator 2023.3.36712, fabric-1.20.1, 64-bit, 31904 MB, Windows 10, JVM 17.0.7, JAVA_HOME: C:\Program Files\Pylo\MCreator\jdk, started on: 2024-01-28-14:35:23

> Configure project :
Fabric Loom: 1.4.6
> Task :compileJava FAILED
C:\Users\Alzrag\MCreatorWorkspaces\alzrags_recipies\src\main\java\net\mcreator\alzragsrecipies\procedures\BladeOfDivergenceAbilityProcedure.java:16: error: lambda body is neither value nor void compatible UseItemCallback.EVENT.register((player, level, hand) -> {
^
C:\Users\Alzrag\MCreatorWorkspaces\alzrags_recipies\src\main\java\net\mcreator\alzragsrecipies\procedures\BladeOfDivergenceAbilityProcedure.java:16: error: incompatible types: bad return type in lambda expression UseItemCallback.EVENT.register((player, level, hand) -> {
^
missing return value
C:\Users\Alzrag\MCreatorWorkspaces\alzrags_recipies\src\main\java\net\mcreator\alzragsrecipies\procedures\BladeOfDivergenceAbilityProcedure.java:18: error: incompatible types: bad return type in lambda expression return;
^
missing return value
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
3 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
> Run with --info option to get more log output.
> Run with --scan to get full insights.
BUILD FAILED in 1s
1 actionable task: 1 executed

BUILD FAILED
Task completed in 3 seconds
 

 

and this is the codewhere the problem is i beleive

 

public class BladeOfDivergenceAbilityProcedure {

public BladeOfDivergenceAbilityProcedure() {
UseItemCallback.EVENT.register((player, level, hand) -> {
if (hand != player.getUsedItemHand())
return;
execute(player);
return InteractionResultHolder.pass(player.getItemInHand(hand));
});
}