Get light level gives wrong integer

Started by flaviomazzoli on

Topic category: Troubleshooting, bugs, and solutions

Joined Jun 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Get light level gives wrong integer

I’m making a mod where you can grow plants, but they require day/night cycles to grow properly. To implement this, I wanted to check the light level to determine if the plant is getting enough light. If the light level is greater than 9, it should increase an NBT variable, and during the night, it should decrease that variable. If the NBT variable exceeds certain limits, the plant should break.

However, whenever I try to check the light level, the game returns the maximum possible light level at that position, not the actual light level at that moment. For example, even if it’s night, the light level still shows 15 because technically, during the day, the light at that spot could reach an intensity of 15.

Is there a way to check the real light level on that moment? I even tried the Get light level of type sky at x: x y: y+1 z: z, but I got 0 light, even during the day? Am i missing something? What can I do to fix this?

Light level check

If you want to see the full procedure click HERE