Opposite Event Conditions

Started by SkeletonKing on

Topic category: Advanced modding

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Opposite Event Conditions

So after looking around for this kind of topic, I've found that adding '!' to the front of the command reverses it. However, whenever I use this it just spits out errors. Here's the log:

 

Executing gradle command: clean build
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
C:\Pylo\MCreator171>cd forge
C:\Pylo\MCreator171\forge>SET "JAVA_HOME=C:\Pylo\MCreator171\jdk64\"
C:\Pylo\MCreator171\forge>SET JAVA_EXE=%JAVA_HOME%\bin\java.exe
C:\Pylo\MCreator171\forge>SET PATH=%JAVA_HOME%\bin\;%PATH%
C:\Pylo\MCreator171\forge>gradlew -Dorg.gradle.jvmargs="-Xms625m -Xmx2048m" clean build
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/2.14/userguide/gradle_daemon.html.
This mapping 'snapshot_20160518' was designed for MC 1.9.4! Use at your own peril.
#################################################
         ForgeGradle 2.2-SNAPSHOT-2112b0a        
  https://github.com/MinecraftForge/ForgeGradle  
#################################################
               Powered by MCP unknown               
             http://modcoderpack.com             
         by: Searge, ProfMobius, Fesh0r,         
         R4wk, ZeuX, IngisKahn, bspkrs           
#################################################
:clean
:deobfCompileDummyTask
:deobfProvidedDummyTask
:sourceApiJava
:compileApiJava UP-TO-DATE
:processApiResources UP-TO-DATE
:apiClasses UP-TO-DATE
:sourceMainJava
C:\Pylo\MCreator171\forge\build\sources\main\java\mod\mcreator\mcreator_mechSuit.java:122: error: cannot find symbol
            if (!hasPlayerInInventory[mcreator_battery.block]) {
                 ^
  symbol: variable hasPlayerInInventory
C:\Pylo\MCreator171\forge\build\sources\main\java\mod\mcreator\mcreator_mechSuit.java:122: error: incompatible types: Item cannot be converted to int
            if (!hasPlayerInInventory[mcreator_battery.block]) {
                                                      ^
C:\Pylo\MCreator171\forge\build\sources\main\java\mod\mcreator\mcreator_mechSuit.java:154: error: cannot find symbol
            if (!hasPlayerInInventory[mcreator_battery.block]) {
                 ^
  symbol: variable hasPlayerInInventory
C:\Pylo\MCreator171\forge\build\sources\main\java\mod\mcreator\mcreator_mechSuit.java:154: error: incompatible types: Item cannot be converted to int
            if (!hasPlayerInInventory[mcreator_battery.block]) {
                                                      ^
C:\Pylo\MCreator171\forge\build\sources\main\java\mod\mcreator\mcreator_mechSuit.java:186: error: cannot find symbol
            if (!hasPlayerInInventory[mcreator_battery.block]) {
                 ^
  symbol: variable hasPlayerInInventory
C:\Pylo\MCreator171\forge\build\sources\main\java\mod\mcreator\mcreator_mechSuit.java:186: error: incompatible types: Item cannot be converted to int
            if (!hasPlayerInInventory[mcreator_battery.block]) {
                                                      ^
C:\Pylo\MCreator171\forge\build\sources\main\java\mod\mcreator\mcreator_mechSuit.java:218: error: cannot find symbol
            if (!hasPlayerInInventory[mcreator_battery.block]) {
:compileJava FAILED  symbol: variable hasPlayerInInventory

                 ^
C:\Pylo\MCreator171\forge\build\sources\main\java\mod\mcreator\mcreator_mechSuit.java:218: error: incompatible types: Item cannot be converted to int
            if (!hasPlayerInInventory[mcreator_battery.block]) {
                                                      ^
8 errors
FAILURE: Build failed with an exception.
BUILD FAILED
* What went wrong:
Execution failed for task ':compileJava'.
Total time: 9.663 secs
> 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.
C:\Pylo\MCreator171\forge>
Task completed with return code 0 in 10100 milliseconds

 

I don't really code so I don't know what any of this means, but any help would be appreciated!

Joined Dec 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
put the '!' in a seprate one
Sat, 02/11/2017 - 20:58

put the '!' in a seprate one of these (). For example..

 if (!(hasPlayerInInventory[mcreator_battery.block])) {

}
 

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
RE:put the '!' in a seprate one
Sat, 02/11/2017 - 22:32

@#1 I get this:

Executing gradle command: clean build
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
C:\Pylo\MCreator171>cd forge
C:\Pylo\MCreator171\forge>SET "JAVA_HOME=C:\Pylo\MCreator171\jdk64\"
C:\Pylo\MCreator171\forge>SET JAVA_EXE=%JAVA_HOME%\bin\java.exe
C:\Pylo\MCreator171\forge>SET PATH=%JAVA_HOME%\bin\;%PATH%
C:\Pylo\MCreator171\forge>gradlew -Dorg.gradle.jvmargs="-Xms625m -Xmx2048m" clean build
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/2.14/userguide/gradle_daemon.html.
This mapping 'snapshot_20160518' was designed for MC 1.9.4! Use at your own peril.
#################################################
         ForgeGradle 2.2-SNAPSHOT-2112b0a        
  https://github.com/MinecraftForge/ForgeGradle  
#################################################
               Powered by MCP unknown               
             http://modcoderpack.com             
         by: Searge, ProfMobius, Fesh0r,         
         R4wk, ZeuX, IngisKahn, bspkrs           
#################################################
:clean
:deobfCompileDummyTask
:deobfProvidedDummyTask
:sourceApiJava
:compileApiJava UP-TO-DATE
:processApiResources UP-TO-DATE
:apiClasses UP-TO-DATE
:sourceMainJava
C:\Pylo\MCreator171\forge\build\sources\main\java\mod\mcreator\mcreator_mechSuit.java:122: error: cannot find symbol
            if (!(hasPlayerInInventory[mcreator_battery.block])) {
                  ^
  symbol: variable hasPlayerInInventory
C:\Pylo\MCreator171\forge\build\sources\main\java\mod\mcreator\mcreator_mechSuit.java:122: error: incompatible types: Item cannot be converted to int
            if (!(hasPlayerInInventory[mcreator_battery.block])) {
                                                       ^
C:\Pylo\MCreator171\forge\build\sources\main\java\mod\mcreator\mcreator_mechSuit.java:154: error: cannot find symbol
            if (!(hasPlayerInInventory[mcreator_battery.block])) {
                  ^
  symbol: variable hasPlayerInInventory
C:\Pylo\MCreator171\forge\build\sources\main\java\mod\mcreator\mcreator_mechSuit.java:154: error: incompatible types: Item cannot be converted to int
            if (!(hasPlayerInInventory[mcreator_battery.block])) {
                                                       ^
C:\Pylo\MCreator171\forge\build\sources\main\java\mod\mcreator\mcreator_mechSuit.java:186: error: cannot find symbol
            if (!(hasPlayerInInventory[mcreator_battery.block])) {
                  ^
  symbol: variable hasPlayerInInventory
C:\Pylo\MCreator171\forge\build\sources\main\java\mod\mcreator\mcreator_mechSuit.java:186: error: incompatible types: Item cannot be converted to int
            if (!(hasPlayerInInventory[mcreator_battery.block])) {
:compileJava FAILED
                                                       ^
C:\Pylo\MCreator171\forge\build\sources\main\java\mod\mcreator\mcreator_mechSuit.java:218: error: cannot find symbol
BUILD FAILED
            if (!(hasPlayerInInventory[mcreator_battery.block])) {
Total time: 9.441 secs
                  ^
  symbol: variable hasPlayerInInventory
C:\Pylo\MCreator171\forge\build\sources\main\java\mod\mcreator\mcreator_mechSuit.java:218: error: incompatible types: Item cannot be converted to int
            if (!(hasPlayerInInventory[mcreator_battery.block])) {
                                                       ^
8 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.
C:\Pylo\MCreator171\forge>
Task completed with return code 0 in 9905 milliseconds

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
RE:RE:put the '!' in a seprate one
Sat, 02/11/2017 - 22:39

Nevermind I finally got it to work! With some searching, I was able to find different Java functions for NOT operators. Instead of using '!', I used 'else' along with some formatting and it works now! Thanks for trying @#1