Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

DarkNoobs12

Members
  • Joined

  • Last visited

Everything posted by DarkNoobs12

  1. Yea, I noticed its intended purpose from the behaviour of the outputs. I was talking more about the way it was coded through multiple functions that called each other. Again, my confusion probably came from a lack of Java background. I see, seems to be a useful feature. Thanks for the answer ? It worked, thank you!
  2. On a side note, what is up with this getLightValue() function? My coding background isn't really in Java, so I might be missing something, but I went into the source code for it and it looks useless and kind of a rabbit hole. This is the getLightValue() I called, implemented in net.minecraftforge.common.extensions.IForgeBlockState: default int getLightValue(IBlockReader world, BlockPos pos) { return getBlockState().getBlock().getLightValue(getBlockState(), world, pos); } It calls a different getLightValue(), which is in net.minecraftforge.common.extensions.IForgeBlock: default int getLightValue(BlockState state, IBlockReader world, BlockPos pos) { return state.getLightValue(); } This getLightValue() calls yet another getLightValue(), and it only requires the BlockState to be called. This getLightValue() is in the net.minecraft.block.BlockState: public int getLightValue() { return this.lightLevel; } Is this a java thing, or just the leftovers of previous versions?
  3. Hi, I just started modding and tried to create a simple item that shows the light level the player is in, like in F3, but less debugging mode and more of a real item(for immersion purposes). From all my trials so far it seems the functions for Light level have been changed recently, since all previous posts mention functions I haven't been able to find, or at least IntelliJ hasn't found them. BlockPos pos = player.getPosition(); BlockState feet = world.getBlockState(pos); System.out.println(feet.getLightValue(world,pos)); This is my code, but it outputs the light level the block is emitting, not the light level itself. Meaning I get 0 next to a torch, and 14 when I stand on the torch. What function would give the value I'm looking for?

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.