Variable entityiterator is already defined

Started by EnergyDevelop on

Topic category: Help with modding (Java Edition)

Last seen on 13:42, 9. Jan 2022
Joined Nov 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Variable entityiterator is already defined

I've been trying to work on my sun breathing sword (totally not inspired by a particular anime), it has multiple modes.

Here is the procedure:

https://www.mediafire.com/file/g0jvd8dasnh7vbb/sun_sword_procedure.ptpl…

(I couldnt attach it as an image as its quite big and wont fit.)

It was working completely fine until I launched and then it just broke.

 

I'm getting this in the output:

 
Executing Gradle task: build 
Build info: MCreator 2021.2.36710, forge-1.16.5, 64-bit, 16208 MB, Windows 10, JVM 11.0.11, JAVA_HOME: C:\Program Files\Pylo\MCreator\jdk 
> Task :compileJava 
C:\Users\Admin\MCreatorWorkspaces\energix_demonslayer\src\main\java\me\energix\demonslayer\procedures\HitBySunNichirinProcedure.java:110: error: variable entityiterator is already defined in method executeProcedure(java.util.Map ) 
            for (Entity entityiterator : _entfound) { 
                        ^ 
C:\Users\Admin\MCreatorWorkspaces\energix_demonslayer\src\main\java\me\energix\demonslayer\procedures\HitBySunNichirinProcedure.java:158: error: variable entityiterator is already defined in method executeProcedure(java.util.Map ) 
            for (Entity entityiterator : _entfound) { 
                        ^ 
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 --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 
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.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/7.1.1/userguide/command_line_interface.html#sec:command_line_warnings 
BUILD FAILED in 6s 
1 actionable task: 1 executed 
BUILD FAILED 
Task completed in 9 seconds

Would anyone know what to do in this situation?

Last seen on 15:46, 5. Dec 2021
Joined Nov 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You are using two entitys…
Sun, 11/28/2021 - 10:18

You are using two entitys iterators, change the java code or one entity iterator

Last seen on 15:46, 5. Dec 2021
Joined Nov 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Or use one entity iterator*
Sun, 11/28/2021 - 10:19

Or use one entity iterator*

Last seen on 13:42, 9. Jan 2022
Joined Nov 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
But they are in different…
Sun, 11/28/2021 - 10:28

But they are in different places, shouldnt one be in one scope and the other be in another? Also, I tried changing the java code and that didnt work, it stopped the crashing but completely broke the sword.

You are using entity…
Sun, 11/28/2021 - 18:33

You are using entity iterator outside for each entity procedure block, this will of course not work

Last seen on 13:42, 9. Jan 2022
Joined Nov 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
So you cant use entity…
Sun, 11/28/2021 - 19:50

So you cant use entity iterator twice in one procedure? Would I have to use multiple procedures and call them then?

You can, this is not the…
Mon, 11/29/2021 - 18:52

You can, this is not the problem. The problem is 

You are using entity iterator outside "for each entity" procedure block, this will of course not work