Compilation error

Published by Pastis444 on
Status
Invalid
Issue description

Hello,
When I try to compile or lunch Minecraft in MCreator that doesn't function. 
I'm no a pro in java and i Don't know why that doesn't function.
Sorry for my English, I'm french and i speak not good English sorry.
My mod is supposed to give an item that turns into an iron, diamond or gold. 
Thx you for help me.
Pastis444.

Issue comments

When possible, attach your game logs (full logs, do not crop them, in text format, not screenshots of logs) from the Console tab or terminal and steps to reproduce the bug in your workspace. Please specify which mod elements to check in your workspace too, if applicable.

This page might be helpful with this too: https://mcreator.net/wiki/tips-reporting-bugs-and-issues

Leave a comment when you include the log and I will check why this is happening.

When I try to compile or lunch Minecraft in MCreator that doesn't function. 

Go to console and paste what is says here

Executing Gradle task: runClient

Build info: MCreator 2020.2.14217, 1.12.2, 64-bit, 7058 MB, Windows 10, JVM 1.8.0_232, JAVA_HOME: E:\Program Files\Pylo\MCreator\jdk

This mapping 'snapshot_20171003' was designed for MC 1.12! Use at your own peril.

#################################################

ForgeGradle 2.3-SNAPSHOT-6084129e

https://github.com/MinecraftForge/ForgeGradle

#################################################

Powered by MCP

http://modcoderpack.com

by: Searge, ProfMobius, R4wk, ZeuX

Fesh0r, IngisKahn, bspkrs, LexManos

#################################################

:deobfCompileDummyTask

:deobfProvidedDummyTask

:sourceApiJava UP-TO-DATE

:compileApiJava NO-SOURCE

:processApiResources NO-SOURCE

:apiClasses UP-TO-DATE

:sourceMainJava UP-TO-DATE

D:\Utilisateurs\Pastis444\Documents\MCreator\build\sources\main\java\net\mcreator\hystriume\procedure\ProcedureRandomItemItemInInventoryTick.java:11: warning: And is internal proprietary API and may be removed in a future release

import com.sun.org.apache.xpath.internal.operations.And;

^

D:\Utilisateurs\Pastis444\Documents\MCreator\build\sources\main\java\net\mcreator\hystriume\procedure\ProcedureRandomItemItemInInventoryTick.java:11: warning: And is internal proprietary API and may be removed in a future release

import com.sun.org.apache.xpath.internal.operations.And;

^

D:\Utilisateurs\Pastis444\Documents\MCreator\build\sources\main\java\net\mcreator\hystriume\procedure\ProcedureRandomItemItemInInventoryTick.java:11: warning: And is internal proprietary API and may be removed in a future release

import com.sun.org.apache.xpath.internal.operations.And;

^

D:\Utilisateurs\Pastis444\Documents\MCreator\build\sources\main\java\net\mcreator\hystriume\procedure\ProcedureRandomItemItemInInventoryTick.java:34: error: bad operand types for binary operator '' 
    
if ((0 <= (Lingot) < 1)) {

^

first type: boolean

second type: int

D:\Utilisateurs\Pastis444\Documents\MCreator\build\sources\main\java\net\mcreator\hystriume\procedure\ProcedureRandomItemItemInInventoryTick.java:41: error: bad operand types for binary operator '' 
    
if ((1 <= (Lingot) < 2)) {

^

first type: boolean

second type: int

D:\Utilisateurs\Pastis444\Documents\MCreator\build\sources\main\java\net\mcreator\hystriume\procedure\ProcedureRandomItemItemInInventoryTick.java:48: error: bad operand types for binary operator '' 
    
if ((2 <= (Lingot) < 3)) {

^

first type: boolean

second type: int

D:\Utilisateurs\Pastis444\Documents\MCreator\build\sources\main\java\net\mcreator\hystriume\procedure\ProcedureRandomItemItemInInventoryTick.java:55: error: bad operand types for binary operator '' 
    
if ((3 <= (Lingot) < 4)) {

^

first type: boolean

second type: int

D:\Utilisateurs\Pastis444\Documents\MCreator\build\sources\main\java\net\mcreator\hystriume\procedure\ProcedureRandomItemItemInInventoryTick.java:62: error: bad operand types for binary operator '' 
    
if ((4 <= (Lingot) < 5)) {

^

first type: boolean

second type: int

D:\Utilisateurs\Pastis444\Documents\MCreator\build\sources\main\java\net\mcreator\hystriume\procedure\ProcedureRandomItemItemInInventoryTick.java:69: error: bad operand types for binary operator '' 
    
if ((5 <= (Lingot) < 6)) {

^

first type: boolean

second type: int

D:\Utilisateurs\Pastis444\Documents\MCreator\build\sources\main\java\net\mcreator\hystriume\procedure\ProcedureRandomItemItemInInventoryTick.java:76: error: bad operand types for binary operator '' 
    
if ((6 <= (Lingot) < 7)) {

^

first type: boolean

second type: int

D:\Utilisateurs\Pastis444\Documents\MCreator\build\sources\main\java\net\mcreator\hystriume\procedure\ProcedureRandomItemItemInInventoryTick.java:83: error: bad operand types for binary operator '' 
    
if ((7 <=(Lingot) < 8)) {

^

first type: boolean

second type: int

D:\Utilisateurs\Pastis444\Documents\MCreator\build\sources\main\java\net\mcreator\hystriume\procedure\ProcedureRandomItemItemInInventoryTick.java:90: error: bad operand types for binary operator '=' 
    
if ((8 <= (Lingot) <= 9)) {

^

first type: boolean

second type: int

D:\Utilisateurs\Pastis444\Documents\MCreator\build\sources\main\java\net\mcreator\hystriume\procedure\ProcedureRandomItemItemInInventoryTick.java:97: error: bad operand types for binary operator '' 
    
if ((9 <= (Lingot) < 10)) {

^

first type: boolean

second type: int

D:\Utilisateurs\Pastis444\Documents\MCreator\build\sources\main\java\net\mcreator\hystriume\procedure\ProcedureRandomItemItemInInventoryTick.java:106: error: cannot find symbol 
    
((EntityPlayer) entity).inventory.clearMatchingItems(new ItemStack(ItemRandomItem.block, (int) (1)).getItem(), -1, (int) 1, null);

^

symbol: variable ItemRandomItem

location: class ProcedureRandomItemItemInInventoryTick

11 errors

3 warnings

: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

BUILD FAILED in 24s

5 actionable tasks: 3 executed, 2 up-to-date

BUILD FAILED

Task completed in 29251 milliseconds

  1. You locked the code and did not tell this in the ticket -> you lock the code, MCreator does not write in it -> your responsibility for proper code
  2. What is this abomination?

0 <= (Lingot) < 1

If you want to write Java code, please learn it first. This is now how you compare if a value is in range. You do this:

(Lingot => 0) && (Lingot < 1)

assuming your code wanted to check if lingot is in [0, 1) interval.

You could do in range compression with procedures without writing the code, though.

I have change my code with your instruction and that function, thx !