Error with gradle

I use delayed item registration in my mod. After I added the first item and tried to run minecraft I got this error. My minecraft version is 1.20.1 forge 2023.06.26-1.20.1 parchment.

21:46:12: Executing 'runClient'...


> Configure project :
Java: 17.0.6, JVM: 17.0.6+10 (Eclipse Adoptium), Arch: amd64

> Task :compileJava FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/8.1.1/userguide/command_line_interface.html#sec:command_line_warnings
1 actionable task: 1 executed
C:\Users\forest\Desktop\mod\BigMod\src\main\java\net\forest\bigmod\items\ModItems.java:14: error: illegal start of expression
    public static final RegistryObject<Item> RUBY = ITEMS.register("ruby",
    ^
C:\Users\forest\Desktop\mod\BigMod\src\main\java\net\forest\bigmod\items\ModItems.java:19: error: <identifier> expected
            DeferredRegister.create(ForgeRegistries.ITEMS, BigMod.MOD_ID);
                                   ^
C:\Users\forest\Desktop\mod\BigMod\src\main\java\net\forest\bigmod\items\ModItems.java:19: error: <identifier> expected
            DeferredRegister.create(ForgeRegistries.ITEMS, BigMod.MOD_ID);
                                                         ^
C:\Users\forest\Desktop\mod\BigMod\src\main\java\net\forest\bigmod\items\ModItems.java:19: error: <identifier> expected
            DeferredRegister.create(ForgeRegistries.ITEMS, BigMod.MOD_ID);
                                                                        ^
4 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 --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 3s
21:46:16: Execution finished 'runClient'.

What is unclear from your output?
Your ModItems.java file is not a valid Java file, there are syntax errors so compilation fails.
This is not a Gradle problem or question. :wink:

1 Like