Faced with the problem of variables.

Started by Danil2000707 on

Topic category: Help with modding (Java Edition)

Last seen on 17:31, 13. Feb 2023
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Faced with the problem of variables.

Faced with the problem of variables. Here I have a variable and at a certain action it increases by 0.1. This procedure is repeated several times and the variable becomes 0.300000004. Is there any way to fix this? To always have the correct number

This is due to Java rounding…
Sun, 02/07/2021 - 16:36

This is due to Java rounding. If you want exact numbers, use integers (1, 2, 3, -4, ...) and avoid any decimal numbers and operations.

Last seen on 17:31, 13. Feb 2023
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Okay I get it
Sun, 02/07/2021 - 16:43

Okay I get it

Last seen on 17:31, 13. Feb 2023
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Are there any procedures to…
Sun, 02/07/2021 - 17:41

Are there any procedures to round numbers to 0.1 or 0.2?