The mod does not compile

Started by RainbowMaxim on

Topic category: Help with MCreator software

Last seen on 11:21, 16. May 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The mod does not compile

Please help my mod does not compile, that's what comes out at the end.

> Task :compileJava 

C:\MCreatorWorkspaces\benten\src\main\java\net\mcreator\benten\BentenMod.java:59: error: package NetworkEvent does not exist 

    public static <T> void addNetworkMessage(Class<T> messageType, BiConsumer<T, FriendlyByteBuf> encoder, Function<FriendlyByteBuf, T> decoder, BiConsumer<T, Supplier<NetworkEvent.Context>> messageConsumer) { 

                                                                                                                                                                                    ^ 

C:\MCreatorWorkspaces\benten\src\main\java\net\mcreator\benten\BentenMod.java:56: error: cannot find symbol 

    public static final SimpleChannel PACKET_HANDLER = NetworkRegistry.newSimpleChannel(new ResourceLocation(MODID, MODID), () -> PROTOCOL_VERSION, PROTOCOL_VERSION::equals, PROTOCOL_VERSION::equals); 

                                                                      ^ 

  symbol:   method newSimpleChannel(ResourceLocation,()->PROTOC[...]RSION,PROTOCOL_V[...]quals,PROTOCOL_V[...]quals) 

  location: class NetworkRegistry 

2 errors 

> Task :compileJava FAILED 

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 42s 

1 actionable task: 1 executed 

 

BUILD FAILED 

Task completed in 46 seconds

If anything, don't write what to look for elsewhere, I searched everything, did everything, no deleting the cache or the gradle folder does not help. I reinstalled and did everything, it doesn't work. And this is a pure project. If you know, please tell me here.