Topic category: Help with MCreator software
So in the Minecraft mod I'm making, I switched to 2020.2. I mostly fixed all the conversion issues with the mod, but one big problem I have is dealing with variables. One of my mod elements has a build error and outputs this to the console:
C:\Users\Owner\MCreatorWorkspaces\versions of mods2\the_elven_forest\build\sources\main\java\net\mcreator\the_elven_forest\procedure\ProcedureQuestElfTurnInQuest.java:116: error: incompatible types: possible lossy conversion from double to int
_setstack.setCount((Item1));
^
C:\Users\Owner\MCreatorWorkspaces\versions of mods2\the_elven_forest\build\sources\main\java\net\mcreator\the_elven_forest\procedure\ProcedureQuestElfTurnInQuest.java:121: error: incompatible types: possible lossy conversion from double to int
_setstack.setCount((Item2));
^
C:\Users\Owner\MCreatorWorkspaces\versions of mods2\the_elven_forest\build\sources\main\java\net\mcreator\the_elven_forest\procedure\ProcedureQuestElfTurnInQuest.java:217: error: incompatible types: possible lossy conversion from double to int
_setstack.setCount((Item1));
^
C:\Users\Owner\MCreatorWorkspaces\versions of mods2\the_elven_forest\build\sources\main\java\net\mcreator\the_elven_forest\procedure\ProcedureQuestElfTurnInQuest.java:222: error: incompatible types: possible lossy conversion from double to int
_setstack.setCount((Item2));
^
C:\Users\Owner\MCreatorWorkspaces\versions of mods2\the_elven_forest\build\sources\main\java\net\mcreator\the_elven_forest\procedure\ProcedureQuestElfTurnInQuest.java:227: error: incompatible types: possible lossy conversion from double to int
_setstack.setCount((Item3));
^
C:\Users\Owner\MCreatorWorkspaces\versions of mods2\the_elven_forest\build\sources\main\java\net\mcreator\the_elven_forest\procedure\ProcedureQuestElfTurnInQuest.java:232: error: incompatible types: possible lossy conversion from double to int
_setstack.setCount((Item4));
^
I am unsure of why the program thinks it is incorrect, as in a previous version of the mod it was working fine. I believe the arrows are pointing to the space bars. To be clear, the mod element I'm working with is unlocked and within the default editor. If anyone knows how to fix this, let me know! =)
Hmm... This does seem to be a glitch with MCreator. I'm assuming that "Item1 - Item4" are local variables? The problem here is that number variables are saved as "double" variables (meaning they can have a decimal point (i.e 2.5 or 3.1 or something)), but when you are trying to set the number of items in the itemstack, it requires an "integer" variable (whole numbers only).
I really think it's time that MCreator lets you choose between Double and Integer variables when making a local variable.
So, what does this mean for you? I don't know, honestly. Perhaps try using the "round" block to round your variables to the nearest whole number?
why are you using 2020.2 though
Thanks for the info! However, I made a workaround where I used items instead of variables for this. Thx =)
I think I had a similar issue, simply removing the variables from the procedure then re-adding them should fix it